Class Mimic
- Namespace
- Dynamitey.DynamicObjects
- Assembly
- Dynamitey.Community.dll
Class for TDD, used for mocking any dynamic object
public class Mimic : DynamicObject, IDynamicMetaObjectProvider
- Inheritance
-
Mimic
- Implements
- Inherited Members
Constructors
Mimic()
Initializes a new instance of the Mimic class.
[RequiresDynamicCode("Constructing a Mimic instantiates System.Dynamic.DynamicObject, whose default constructor requires the DLR's runtime code generation; not supported when AOT-compiled.")]
public Mimic()
Methods
TryBinaryOperation(BinaryOperationBinder, object, out object?)
Override on DynamicObject
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Constructs another Mimic. This is a DynamicObject.TryBinaryOperation override: it can't carry [RequiresDynamicCode] itself without mismatching the unannotated base member, and the DLR invokes it only after the consumer's own dynamic call site already triggered the framework's warning.")]
public override bool TryBinaryOperation(BinaryOperationBinder binder, object arg, out object? result)
Parameters
binderBinaryOperationBinderargobjectresultobject
Returns
TryConvert(ConvertBinder, out object?)
Override on DynamicObject
[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Calls the annotated Dynamic.InvokeConstructor. This is a DynamicObject.TryConvert override: it can't carry [RequiresUnreferencedCode] itself without mismatching the unannotated base member, and the DLR invokes it only after the consumer's own dynamic conversion already triggered the framework's warning.")]
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Same Dynamic.InvokeConstructor call as above; see the IL2026 suppression on this member.")]
public override bool TryConvert(ConvertBinder binder, out object? result)
Parameters
binderConvertBinderresultobject
Returns
TryCreateInstance(CreateInstanceBinder, object?[]?, out object)
Override on DynamicObject
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Constructs another Mimic. This is a DynamicObject override: it can't carry [RequiresDynamicCode] itself without mismatching the unannotated base member, and the DLR invokes it only after the consumer's own dynamic call site already triggered the framework's warning.")]
public override bool TryCreateInstance(CreateInstanceBinder binder, object?[]? args, out object result)
Parameters
binderCreateInstanceBinderargsobject[]resultobject
Returns
TryDeleteIndex(DeleteIndexBinder, object?[]?)
Override on DynamicObject
public override bool TryDeleteIndex(DeleteIndexBinder binder, object?[]? indexes)
Parameters
binderDeleteIndexBinderindexesobject[]
Returns
TryDeleteMember(DeleteMemberBinder)
Override on DynamicObject
public override bool TryDeleteMember(DeleteMemberBinder binder)
Parameters
binderDeleteMemberBinder
Returns
TryGetIndex(GetIndexBinder, object?[]?, out object)
Override on DynamicObject
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Constructs another Mimic. This is a DynamicObject override: it can't carry [RequiresDynamicCode] itself without mismatching the unannotated base member, and the DLR invokes it only after the consumer's own dynamic call site already triggered the framework's warning.")]
public override bool TryGetIndex(GetIndexBinder binder, object?[]? indexes, out object result)
Parameters
binderGetIndexBinderindexesobject[]resultobject
Returns
TryGetMember(GetMemberBinder, out object?)
Override on DynamicObject
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Constructs another Mimic. This is a DynamicObject override: it can't carry [RequiresDynamicCode] itself without mismatching the unannotated base member, and the DLR invokes it only after the consumer's own dynamic call site already triggered the framework's warning.")]
public override bool TryGetMember(GetMemberBinder binder, out object? result)
Parameters
binderGetMemberBinderresultobject
Returns
TryInvoke(InvokeBinder, object?[]?, out object?)
Override on DynamicObject
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Constructs another Mimic. This is a DynamicObject override: it can't carry [RequiresDynamicCode] itself without mismatching the unannotated base member, and the DLR invokes it only after the consumer's own dynamic call site already triggered the framework's warning.")]
public override bool TryInvoke(InvokeBinder binder, object?[]? args, out object? result)
Parameters
binderInvokeBinderargsobject[]resultobject
Returns
TryInvokeMember(InvokeMemberBinder, object?[]?, out object?)
Override on DynamicObject
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Constructs another Mimic. This is a DynamicObject override: it can't carry [RequiresDynamicCode] itself without mismatching the unannotated base member, and the DLR invokes it only after the consumer's own dynamic call site already triggered the framework's warning.")]
public override bool TryInvokeMember(InvokeMemberBinder binder, object?[]? args, out object? result)
Parameters
binderInvokeMemberBinderargsobject[]resultobject
Returns
TrySetIndex(SetIndexBinder, object?[]?, object?)
Override on DynamicObject
public override bool TrySetIndex(SetIndexBinder binder, object?[]? indexes, object? value)
Parameters
binderSetIndexBinderindexesobject[]valueobject
Returns
TrySetMember(SetMemberBinder, object?)
Override on DynamicObject
public override bool TrySetMember(SetMemberBinder binder, object? value)
Parameters
binderSetMemberBindervalueobject
Returns
TryUnaryOperation(UnaryOperationBinder, out object?)
Override on DynamicObject
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Constructs another Mimic. This is a DynamicObject override: it can't carry [RequiresDynamicCode] itself without mismatching the unannotated base member, and the DLR invokes it only after the consumer's own dynamic call site already triggered the framework's warning.")]
public override bool TryUnaryOperation(UnaryOperationBinder binder, out object? result)
Parameters
binderUnaryOperationBinderresultobject