Class MockComputation
Mocks a computation
Inherited Members
Namespace: NMF.Transformations.Tests
Assembly: NMF.Transformations.dll
Syntax
public class MockComputation : Computation, IPersistor, ITraceEntry
Constructors
| Edit this page View SourceMockComputation(object[], GeneralTransformationRule, IComputationContext)
Creates a new mocked computation
Declaration
public MockComputation(object[] input, GeneralTransformationRule rule, IComputationContext context)
Parameters
Type | Name | Description |
---|---|---|
object[] | input | The input for the mocked computation |
GeneralTransformationRule | rule | The transformation rule for the mocked computation |
IComputationContext | context | The transformation context |
MockComputation(object[], GeneralTransformationRule, IComputationContext, object)
Creates a new mocked computation
Declaration
public MockComputation(object[] input, GeneralTransformationRule rule, IComputationContext context, object output)
Parameters
Type | Name | Description |
---|---|---|
object[] | input | The input for the mocked computation |
GeneralTransformationRule | rule | The transformation rule for the mocked computation |
IComputationContext | context | The transformation context |
object | output | The output for the transformation |
MockComputation(object[], GeneralTransformationRule, ITransformationContext)
Creates a new mocked computation
Declaration
public MockComputation(object[] input, GeneralTransformationRule rule, ITransformationContext context)
Parameters
Type | Name | Description |
---|---|---|
object[] | input | The input for the mocked computation |
GeneralTransformationRule | rule | The transformation rule for the mocked computation |
ITransformationContext | context | The transformation context |
MockComputation(object[], GeneralTransformationRule, ITransformationContext, object)
Creates a new mocked computation
Declaration
public MockComputation(object[] input, GeneralTransformationRule rule, ITransformationContext context, object output)
Parameters
Type | Name | Description |
---|---|---|
object[] | input | The input for the mocked computation |
GeneralTransformationRule | rule | The transformation rule for the mocked computation |
ITransformationContext | context | The transformation context |
object | output | The output for the transformation |
Properties
| Edit this page View SourceOnCreateOutput
Gets or sets a function that should be called when the computation is asked to create its output
Declaration
public Func<object> OnCreateOutput { get; set; }
Property Value
Type | Description |
---|---|
Func<object> |
OnTransform
Gets or sets an action that should be called when the computation is asked to perform its Transform task
Declaration
public Action OnTransform { get; set; }
Property Value
Type | Description |
---|---|
Action |
Output
Gets or sets the output of the MockComputation
Declaration
public object Output { get; set; }
Property Value
Type | Description |
---|---|
object |
Remarks
Unlike the version of the Computation base class, this version ignores the output delay and thus does not throw an exception when accessed when the computation is delayed
OutputCore
Gets or sets the output internal
Declaration
protected override object OutputCore { get; set; }
Property Value
Type | Description |
---|---|
object |
Overrides
Methods
| Edit this page View SourceCreateOutput(IEnumerable)
Creates the output for the given transformation
Declaration
public override object CreateOutput(IEnumerable context)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable | context |
Returns
Type | Description |
---|---|
object | The output |
Overrides
| Edit this page View SourceGetInput(int)
Gets the input at the i-th position
Declaration
public override object GetInput(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index | The index of the desired input parameter |
Returns
Type | Description |
---|---|
object | The input parameter with the i-th position |
Overrides
| Edit this page View SourceTransform()
Performs the Transform operation
Declaration
public override void Transform()