Class TestParameters
TestParameters class holds any named parameters supplied to the test run
public class TestParameters
- Inheritance
-
TestParameters
- Inherited Members
Constructors
TestParameters()
public TestParameters()
Properties
Count
Gets the number of test parameters
public int Count { get; }
Property Value
this[string]
Indexer provides access to the internal dictionary
public string? this[string name] { get; }
Parameters
name
stringName of the parameter
Property Value
- string
Value of the parameter or null if not present
Names
Gets a collection of the test parameter names
public ICollection<string> Names { get; }
Property Value
Methods
Exists(string)
Gets a flag indicating whether a parameter with the specified name exists.
public bool Exists(string name)
Parameters
name
stringName of the parameter
Returns
- bool
True if it exists, otherwise false
Get(string)
Get method is a simple alternative to the indexer
public string? Get(string name)
Parameters
name
stringName of the parameter
Returns
- string
Value of the parameter or null if not present
Get(string, string?)
Get the value of a parameter or a default string
public string? Get(string name, string? defaultValue)
Parameters
Returns
- string
Value of the parameter or default value if not present
Get<T>(string, T)
Get the value of a parameter or return a default
public T Get<T>(string name, T defaultValue)
Parameters
name
stringName of the parameter
defaultValue
TDefault value of the parameter
Returns
- T
Value of the parameter or default value if not present
Type Parameters
T
The return Type