Table of Contents

Class TableParameterValueProvider

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

A parameter value provider from a table row.

public class TableParameterValueProvider : IParameterValueProvider
Inheritance
TableParameterValueProvider
Implements
Inherited Members

Remarks

This will look for a column with a header that matches the parameter name (disregarding case, white space, and underscores). If the column is found, but the content in that cell is blank, then this provider will treat the parameter as not existing. Note that this means it is not possible for this provider to set or override parameter values to blank or null values.

Constructors

TableParameterValueProvider(Table, string[])

Initializes a new instance of the TableParameterValueProvider class.

public TableParameterValueProvider(Table table, string[] row)

Parameters

table Table

The table containing the values.

row string[]

The row in the table from which to retrieve values.

Exceptions

ArgumentNullException

table is null.

ArgumentNullException

row is null.

ArgumentException

table does not have a headers row.

TableParameterValueProvider(Table, string[], params Tuple<string, string>[])

Initializes a new instance of the TableParameterValueProvider class.

public TableParameterValueProvider(Table table, string[] row, params Tuple<string, string>[] columnMappings)

Parameters

table Table

The table containing the values.

row string[]

The row in the table from which to retrieve values.

columnMappings Tuple<string, string>[]

Optional column mappings, where Item1 contains the table column name and Item2 contains the parameter name.

Exceptions

ArgumentNullException

table is null.

ArgumentNullException

row is null.

ArgumentException

columnMappings contains one or more mappings with a column or parameter name that is null or empty.

ArgumentException

table does not have a headers row.

Methods

TryGetParameterValue(string, out object)

Tries to provide a parameter value.

public bool TryGetParameterValue(string name, out object value)

Parameters

name string

The name of a parameter. Nested levels should be separated by colons (':').

value object

The retrieved value, or undefined if the value could not be retrieved.

Returns

bool

true if name is not an empty string and the value was retrieved; otherwise false.

Exceptions

ArgumentNullException

name is null.