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
name
string
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
name
stringThe name of the variable to retrieve.
defaultValue
TThe value to return if no variable with the specified
name
andT
type is found.
Returns
- T
The variable with the specified
name
of typeT
, ordefaultValue
if no matching variable is found.
Type Parameters
T
The 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
name
stringName 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
name
stringThe name under which the variable will be stored.
value
TThe value of the variable to store.
tags
string[]An optional list of tags associated with the variable.
Type Parameters
T
The type of the variable to store.