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
tableTableThe table containing the values.
rowstring[]The row in the table from which to retrieve values.
Exceptions
- ArgumentNullException
tableis null.- ArgumentNullException
rowis null.- ArgumentException
tabledoes 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
tableTableThe table containing the values.
rowstring[]The row in the table from which to retrieve values.
columnMappingsTuple<string, string>[]Optional column mappings, where Item1 contains the table column name and Item2 contains the parameter name.
Exceptions
- ArgumentNullException
tableis null.- ArgumentNullException
rowis null.- ArgumentException
columnMappingscontains one or more mappings with a column or parameter name that is null or empty.- ArgumentException
tabledoes 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
namestringThe name of a parameter. Nested levels should be separated by colons (':').
valueobjectThe retrieved value, or undefined if the value could not be retrieved.
Returns
Exceptions
- ArgumentNullException
nameis null.