Class MockComputation
- Namespace
- NMF.Transformations.Tests
- Assembly
- NMF.Transformations.dll
Mocks a computation
public class MockComputation : Computation, IPersistor, ITraceEntry
- Inheritance
-
MockComputation
- Implements
- Inherited Members
- Extension Methods
Constructors
MockComputation(object[], GeneralTransformationRule, IComputationContext)
Creates a new mocked computation
public MockComputation(object[] input, GeneralTransformationRule rule, IComputationContext context)
Parameters
inputobject[]The input for the mocked computation
ruleGeneralTransformationRuleThe transformation rule for the mocked computation
contextIComputationContextThe transformation context
MockComputation(object[], GeneralTransformationRule, IComputationContext, object)
Creates a new mocked computation
public MockComputation(object[] input, GeneralTransformationRule rule, IComputationContext context, object output)
Parameters
inputobject[]The input for the mocked computation
ruleGeneralTransformationRuleThe transformation rule for the mocked computation
contextIComputationContextThe transformation context
outputobjectThe output for the transformation
MockComputation(object[], GeneralTransformationRule, ITransformationContext)
Creates a new mocked computation
public MockComputation(object[] input, GeneralTransformationRule rule, ITransformationContext context)
Parameters
inputobject[]The input for the mocked computation
ruleGeneralTransformationRuleThe transformation rule for the mocked computation
contextITransformationContextThe transformation context
MockComputation(object[], GeneralTransformationRule, ITransformationContext, object)
Creates a new mocked computation
public MockComputation(object[] input, GeneralTransformationRule rule, ITransformationContext context, object output)
Parameters
inputobject[]The input for the mocked computation
ruleGeneralTransformationRuleThe transformation rule for the mocked computation
contextITransformationContextThe transformation context
outputobjectThe output for the transformation
Properties
OnCreateOutput
Gets or sets a function that should be called when the computation is asked to create its output
public Func<object> OnCreateOutput { get; set; }
Property Value
OnTransform
Gets or sets an action that should be called when the computation is asked to perform its Transform task
public Action OnTransform { get; set; }
Property Value
Output
Gets or sets the output of the MockComputation
public object Output { get; set; }
Property Value
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
protected override object OutputCore { get; set; }
Property Value
Methods
CreateOutput(IEnumerable)
Creates the output for the given transformation
public override object CreateOutput(IEnumerable context)
Parameters
contextIEnumerable
Returns
- object
The output
GetInput(int)
Gets the input at the i-th position
public override object GetInput(int index)
Parameters
indexintThe index of the desired input parameter
Returns
- object
The input parameter with the i-th position
Transform()
Performs the Transform operation
public override void Transform()