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
input
object[]The input for the mocked computation
rule
GeneralTransformationRuleThe transformation rule for the mocked computation
context
IComputationContextThe transformation context
MockComputation(object[], GeneralTransformationRule, IComputationContext, object)
Creates a new mocked computation
public MockComputation(object[] input, GeneralTransformationRule rule, IComputationContext context, object output)
Parameters
input
object[]The input for the mocked computation
rule
GeneralTransformationRuleThe transformation rule for the mocked computation
context
IComputationContextThe transformation context
output
objectThe output for the transformation
MockComputation(object[], GeneralTransformationRule, ITransformationContext)
Creates a new mocked computation
public MockComputation(object[] input, GeneralTransformationRule rule, ITransformationContext context)
Parameters
input
object[]The input for the mocked computation
rule
GeneralTransformationRuleThe transformation rule for the mocked computation
context
ITransformationContextThe transformation context
MockComputation(object[], GeneralTransformationRule, ITransformationContext, object)
Creates a new mocked computation
public MockComputation(object[] input, GeneralTransformationRule rule, ITransformationContext context, object output)
Parameters
input
object[]The input for the mocked computation
rule
GeneralTransformationRuleThe transformation rule for the mocked computation
context
ITransformationContextThe transformation context
output
objectThe 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
context
IEnumerable
Returns
- object
The output
GetInput(int)
Gets the input at the i-th position
public override object GetInput(int index)
Parameters
index
intThe 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()