Table of Contents

Class SetTestDataItem

Namespace
Acuit.Pinpoint.Workflows.Testing.Activities
Assembly
Acuit.Pinpoint.Workflows.Testing.dll

An activity that sets the value for a test data item, which will get recorded with the test result when the test completes.

public class SetTestDataItem : Activity, IActivity
Inheritance
SetTestDataItem
Implements
Inherited Members

Remarks

This activity requires an IActiveTest service, which is normally provided by placing this activity within the body of a RecordTest activity.

This is a low-level way to set a test data item value. Normally, the higher-level, more capable TakeValue activity is used to record test data values.

Properties

AdditionalDetails

Gets or sets additional details that will be stored with the test data item. This is optional.

public ValueSource<string> AdditionalDetails { get; set; }

Property Value

ValueSource<string>

Remarks

If this is not specified and if Value produces a value that implements IDataValue, then Descriptor.Units will automatically be used for this.

FailReason

Gets or sets the fail reason to use when failing the test. If this is not set, then "Incorrect {Name}" will be used.

public ValueSource<string> FailReason { get; set; }

Property Value

ValueSource<string>

FailTestIfInvalid

Gets or sets whether to fail the test if IsGood is set and evaluates to false. This is required and defaults to true.

public ValueSource<bool> FailTestIfInvalid { get; set; }

Property Value

ValueSource<bool>

IsGood

Gets or sets the test data item status, where null means None, true means Good, and false means Bad. This is optional.

public ValueSource<bool?> IsGood { get; set; }

Property Value

ValueSource<bool?>

Name

Gets or sets the test data item name. This is required.

public ValueSource<string> Name { get; set; }

Property Value

ValueSource<string>

Value

Gets or sets the value for the test data item. This is required, but it can evaluate to null.

public ValueSource Value { get; set; }

Property Value

ValueSource

Remarks

The value will be converted to an invariant string before saving with the test data item. If the value implements IDataValue, then Descriptor will be used to format the value using the "S" format.

Methods

OnExecuteAsync(ActivityContext, CancellationToken)

Derived classes must implement this to perform the activity.

protected override Task OnExecuteAsync(ActivityContext context, CancellationToken cancellationToken)

Parameters

context ActivityContext

The activity context.

cancellationToken CancellationToken

The cancellation token used to request canceling the activity.

Returns

Task

A task that represents the asynchronous operation.

Exceptions

ArgumentNullException

context is null.

InvalidOperationException

A service required by the activity is not available, or a required activity property value is not set.

Exception

An error occurred while performing the activity.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Remarks

This is expected to produce a string suitable for labeling this activity in a workflow diagram. It should be as specific as possible, but while keeping it very short. In general, it should be the short name of the class (as that is how it would typically be defined in the workflow XAML), optionally followed by other property values of interest in a diagram. The default implementation returns the short name of the class.