TestContext Class

Summary

Provide the context information of the current test. This is an adapter for the internal ExecutionContext class, hiding the internals from the user test.
Namespace
TCLite
Base Types
  • object
graph BT Type-->Base0["object"] Type["TestContext"] class Type type-node

Syntax

public class TestContext

Constructors

Name Summary
TestContext(TestExecutionContext) Construct a TestContext for an ExecutionContext

Fields

Name Constant Value Summary
Parameters
TestParameters object holds parameters for the test run, if any are specified
static

Properties

Name Value Summary
AssertCount int
Gets the number of assertions executed up to this point in the test.
CurrentContext TestContext
Get the current test context. This is created as needed. The user may save the context for use within a test, but it should not be used outside the test for which it is created.
static
CurrentTest TestContext.TestAdapter
Get a representation of the current test.
static
Out TextWriter
Gets a TextWriter that will send output to the current test result.
static
Random IRandomGenerator
Gets the random generator.
Result TestContext.ResultAdapter
Gets a Representation of the TestResult for the current test.
Test TestContext.TestAdapter
Get a representation of the current test.
WorkDirectory string
Gets the directory to be used for outputting files created by this test run.

Methods

Name Value Summary
Write(bool) void
Write the string representation of a boolean value to the current result
static
Write(char) void
Write a char to the current result
static
Write(char[]) void
Write a char array to the current result
static
Write(decimal) void
Write the string representation of a decimal value to the current result
static
Write(double) void
Write the string representation of a double to the current result
static
Write(float) void
Write the string representation of a Single value to the current result
static
Write(int) void
Write the string representation of an Int32 value to the current result
static
Write(long) void
Write the string representation of an Int64 value to the current result
static
Write(object) void
Write the string representation of an object to the current result
static
Write(string, object, object, object) void
Write a formatted string to the current result
static
Write(string, object, object) void
Write a formatted string to the current result
static
Write(string, object) void
Write a formatted string to the current result
static
Write(string, object[]) void
Write a formatted string to the current result
static
Write(string) void
Write a string to the current result
static
Write(uint) void
Write the string representation of a UInt32 value to the current result
static
Write(ulong) void
Write the string representation of a UInt64 value to the current result
static
WriteLine() void
Write a line terminator to the current result
static
WriteLine(bool) void
Write the string representation of a boolean value to the current result followed by a line terminator
static
WriteLine(char) void
Write a char to the current result followed by a line terminator
static
WriteLine(char[]) void
Write a char array to the current result followed by a line terminator
static
WriteLine(decimal) void
Write the string representation of a decimal value to the current result followed by a line terminator
static
WriteLine(double) void
Write the string representation of a double to the current result followed by a line terminator
static
WriteLine(float) void
Write the string representation of a Single value to the current result followed by a line terminator
static
WriteLine(int) void
Write the string representation of an Int32 value to the current result followed by a line terminator
static
WriteLine(long) void
Write the string representation of an Int64 value to the current result followed by a line terminator
static
WriteLine(object) void
Write the string representation of an object to the current result followed by a line terminator
static
WriteLine(string, object, object, object) void
Write a formatted string to the current result followed by a line terminator
static
WriteLine(string, object, object) void
Write a formatted string to the current result followed by a line terminator
static
WriteLine(string, object) void
Write a formatted string to the current result followed by a line terminator
static
WriteLine(string, object[]) void
Write a formatted string to the current result followed by a line terminator
static
WriteLine(string) void
Write a string to the current result followed by a line terminator
static
WriteLine(uint) void
Write the string representation of a UInt32 value to the current result followed by a line terminator
static
WriteLine(ulong) void
Write the string representation of a UInt64 value to the current result followed by a line terminator
static