Table of Contents

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 GeneralTransformationRule

The transformation rule for the mocked computation

context IComputationContext

The 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 GeneralTransformationRule

The transformation rule for the mocked computation

context IComputationContext

The transformation context

output object

The 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 GeneralTransformationRule

The transformation rule for the mocked computation

context ITransformationContext

The 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 GeneralTransformationRule

The transformation rule for the mocked computation

context ITransformationContext

The transformation context

output object

The 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

Func<object>

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

Action

Output

Gets or sets the output of the MockComputation

public object Output { get; set; }

Property Value

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

protected override object OutputCore { get; set; }

Property Value

object

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 int

The 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()