Class TeaPie
- Namespace
- TeaPie
- Assembly
- TeaPie.dll
public sealed class TeaPie
- Inheritance
-
TeaPie
- Inherited Members
- Extension Methods
Properties
ApplicationContext
public IApplicationContext ApplicationContext { get; }
Property Value
CollectionVariables
public VariablesCollection CollectionVariables { get; }
Property Value
EnvironmentVariables
public VariablesCollection EnvironmentVariables { get; }
Property Value
GlobalVariables
public VariablesCollection GlobalVariables { get; }
Property Value
Instance
public static TeaPie? Instance { get; }
Property Value
Logger
public ILogger Logger { get; }
Property Value
Request
The most recently executed HTTP request.
public HttpRequestMessage? Request { get; }
Property Value
Requests
Collection of current test case's HTTP requests accessible by names.
public IReadOnlyDictionary<string, HttpRequestMessage> Requests { get; }
Property Value
Response
The most recently retrieved HTTP response.
public HttpResponseMessage? Response { get; }
Property Value
Responses
Collection of current test case's HTTP responses accessible by names.
public IReadOnlyDictionary<string, HttpResponseMessage> Responses { get; }
Property Value
TestCaseVariables
public VariablesCollection TestCaseVariables { get; }
Property Value
Methods
Exit(int, string?)
public void Exit(int exitCode = 0, string? reason = null)
Parameters
GetHttpClient(string?)
public HttpClient GetHttpClient(string? name = null)
Parameters
namestring
Returns
GetVariable<T>(string, T?)
Attempts to retrieve the first matching variable with the specified name of type
T. If no such variable is found, the defaultValue is returned.
Variables are searched across all levels in the following order: TestCaseVariables, CollectionVariables,
EnvironmentVariables, GlobalVariables.
public T? GetVariable<T>(string name, T? defaultValue = default)
Parameters
namestringThe name of the variable to retrieve.
defaultValueTThe value to return if no variable with the specified
nameandTtype is found.
Returns
- T
The variable with the specified
nameof typeT, ordefaultValueif no matching variable is found.
Type Parameters
TThe type of the variable to retrieve.
SetEnvironment(string)
Set environment to one with given name. Environment must be defined in the environment file.
public void SetEnvironment(string name)
Parameters
namestringName of the environment to be set.
SetVariable<T>(string, T, params string[])
Stores a variable with the specified name of type T
at the Collection level. The variable is tagged with the specified tags, which are optional.
public void SetVariable<T>(string name, T value, params string[] tags)
Parameters
namestringThe name under which the variable will be stored.
valueTThe value of the variable to store.
tagsstring[]An optional list of tags associated with the variable.
Type Parameters
TThe type of the variable to store.