Table of Contents

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

binder BinaryOperationBinder
arg object
result object

Returns

bool

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

binder ConvertBinder
result object

Returns

bool

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

binder CreateInstanceBinder
args object[]
result object

Returns

bool

TryDeleteIndex(DeleteIndexBinder, object?[]?)

Override on DynamicObject

public override bool TryDeleteIndex(DeleteIndexBinder binder, object?[]? indexes)

Parameters

binder DeleteIndexBinder
indexes object[]

Returns

bool

TryDeleteMember(DeleteMemberBinder)

Override on DynamicObject

public override bool TryDeleteMember(DeleteMemberBinder binder)

Parameters

binder DeleteMemberBinder

Returns

bool

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

binder GetIndexBinder
indexes object[]
result object

Returns

bool

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

binder GetMemberBinder
result object

Returns

bool

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

binder InvokeBinder
args object[]
result object

Returns

bool

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

binder InvokeMemberBinder
args object[]
result object

Returns

bool

TrySetIndex(SetIndexBinder, object?[]?, object?)

Override on DynamicObject

public override bool TrySetIndex(SetIndexBinder binder, object?[]? indexes, object? value)

Parameters

binder SetIndexBinder
indexes object[]
value object

Returns

bool

TrySetMember(SetMemberBinder, object?)

Override on DynamicObject

public override bool TrySetMember(SetMemberBinder binder, object? value)

Parameters

binder SetMemberBinder
value object

Returns

bool

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

binder UnaryOperationBinder
result object

Returns

bool