IGLib  1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
NUnit.Framework.TestContext Class Reference

Provide the context information of the current test. This is an adapter for the internal ExecutionContext class, hiding the internals from the user test. More...

+ Collaboration diagram for NUnit.Framework.TestContext:

Classes

class  ResultAdapter
 ResultAdapter adapts a TestResult for consumption by the user test code. More...
 
class  TestAdapter
 TestAdapter adapts a Test for consumption by the user test code. More...
 

Public Member Functions

 TestContext (TestExecutionContext testExecutionContext)
 Construct a TestContext for an ExecutionContext More...
 

Static Public Member Functions

static void Write (bool value)
 Write the string representation of a boolean value to the current result More...
 
static void Write (char value)
 Write a char to the current result More...
 
static void Write (char[] value)
 Write a char array to the current result More...
 
static void Write (double value)
 Write the string representation of a double to the current result More...
 
static void Write (Int32 value)
 Write the string representation of an Int32 value to the current result More...
 
static void Write (Int64 value)
 Write the string representation of an Int64 value to the current result More...
 
static void Write (decimal value)
 Write the string representation of a decimal value to the current result More...
 
static void Write (object value)
 Write the string representation of an object to the current result More...
 
static void Write (Single value)
 Write the string representation of a Single value to the current result More...
 
static void Write (string value)
 Write a string to the current result More...
 
static void Write (UInt32 value)
 Write the string representation of a UInt32 value to the current result More...
 
static void Write (UInt64 value)
 Write the string representation of a UInt64 value to the current result More...
 
static void Write (string format, object arg1)
 Write a formatted string to the current result More...
 
static void Write (string format, object arg1, object arg2)
 Write a formatted string to the current result More...
 
static void Write (string format, object arg1, object arg2, object arg3)
 Write a formatted string to the current result More...
 
static void Write (string format, params object[] args)
 Write a formatted string to the current result More...
 
static void WriteLine ()
 Write a line terminator to the current result More...
 
static void WriteLine (bool value)
 Write the string representation of a boolean value to the current result followed by a line terminator More...
 
static void WriteLine (char value)
 Write a char to the current result followed by a line terminator More...
 
static void WriteLine (char[] value)
 Write a char array to the current result followed by a line terminator More...
 
static void WriteLine (double value)
 Write the string representation of a double to the current result followed by a line terminator More...
 
static void WriteLine (Int32 value)
 Write the string representation of an Int32 value to the current result followed by a line terminator More...
 
static void WriteLine (Int64 value)
 Write the string representation of an Int64 value to the current result followed by a line terminator More...
 
static void WriteLine (decimal value)
 Write the string representation of a decimal value to the current result followed by a line terminator More...
 
static void WriteLine (object value)
 Write the string representation of an object to the current result followed by a line terminator More...
 
static void WriteLine (Single value)
 Write the string representation of a Single value to the current result followed by a line terminator More...
 
static void WriteLine (string value)
 Write a string to the current result followed by a line terminator More...
 
static void WriteLine (UInt32 value)
 Write the string representation of a UInt32 value to the current result followed by a line terminator More...
 
static void WriteLine (UInt64 value)
 Write the string representation of a UInt64 value to the current result followed by a line terminator More...
 
static void WriteLine (string format, object arg1)
 Write a formatted string to the current result followed by a line terminator More...
 
static void WriteLine (string format, object arg1, object arg2)
 Write a formatted string to the current result followed by a line terminator More...
 
static void WriteLine (string format, object arg1, object arg2, object arg3)
 Write a formatted string to the current result followed by a line terminator More...
 
static void WriteLine (string format, params object[] args)
 Write a formatted string to the current result followed by a line terminator More...
 

Properties

static TestContext CurrentContext [get]
 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. More...
 
static TextWriter Out [get]
 Gets a TextWriter that will send output to the current test result. More...
 
TestAdapter Test [get]
 Get a representation of the current test. More...
 
ResultAdapter Result [get]
 Gets a Representation of the TestResult for the current test. More...
 
string TestDirectory [get]
 Gets the directory containing the current test assembly. More...
 
string WorkDirectory [get]
 Gets the directory to be used for outputting files created by this test run. More...
 
Randomizer Random [get]
 Gets the random generator. More...
 

Private Attributes

readonly TestExecutionContext _testExecutionContext
 
TestAdapter _test
 
ResultAdapter _result
 

Detailed Description

Provide the context information of the current test. This is an adapter for the internal ExecutionContext class, hiding the internals from the user test.

Constructor & Destructor Documentation

NUnit.Framework.TestContext.TestContext ( TestExecutionContext  testExecutionContext)
inline

Construct a TestContext for an ExecutionContext

Parameters
testExecutionContextThe ExecutionContext to adapt

Member Function Documentation

static void NUnit.Framework.TestContext.Write ( bool  value)
inlinestatic

Write the string representation of a boolean value to the current result

Referenced by NUnit.Framework.Tests.TestContextTests.TestContextWrite_WritesToResult().

static void NUnit.Framework.TestContext.Write ( char  value)
inlinestatic

Write a char to the current result

static void NUnit.Framework.TestContext.Write ( char[]  value)
inlinestatic

Write a char array to the current result

static void NUnit.Framework.TestContext.Write ( double  value)
inlinestatic

Write the string representation of a double to the current result

static void NUnit.Framework.TestContext.Write ( Int32  value)
inlinestatic

Write the string representation of an Int32 value to the current result

static void NUnit.Framework.TestContext.Write ( Int64  value)
inlinestatic

Write the string representation of an Int64 value to the current result

static void NUnit.Framework.TestContext.Write ( decimal  value)
inlinestatic

Write the string representation of a decimal value to the current result

static void NUnit.Framework.TestContext.Write ( object  value)
inlinestatic

Write the string representation of an object to the current result

static void NUnit.Framework.TestContext.Write ( Single  value)
inlinestatic

Write the string representation of a Single value to the current result

static void NUnit.Framework.TestContext.Write ( string  value)
inlinestatic

Write a string to the current result

static void NUnit.Framework.TestContext.Write ( UInt32  value)
inlinestatic

Write the string representation of a UInt32 value to the current result

static void NUnit.Framework.TestContext.Write ( UInt64  value)
inlinestatic

Write the string representation of a UInt64 value to the current result

static void NUnit.Framework.TestContext.Write ( string  format,
object  arg1 
)
inlinestatic

Write a formatted string to the current result

static void NUnit.Framework.TestContext.Write ( string  format,
object  arg1,
object  arg2 
)
inlinestatic

Write a formatted string to the current result

static void NUnit.Framework.TestContext.Write ( string  format,
object  arg1,
object  arg2,
object  arg3 
)
inlinestatic

Write a formatted string to the current result

static void NUnit.Framework.TestContext.Write ( string  format,
params object[]  args 
)
inlinestatic

Write a formatted string to the current result

static void NUnit.Framework.TestContext.WriteLine ( bool  value)
inlinestatic

Write the string representation of a boolean value to the current result followed by a line terminator

static void NUnit.Framework.TestContext.WriteLine ( char  value)
inlinestatic

Write a char to the current result followed by a line terminator

static void NUnit.Framework.TestContext.WriteLine ( char[]  value)
inlinestatic

Write a char array to the current result followed by a line terminator

static void NUnit.Framework.TestContext.WriteLine ( double  value)
inlinestatic

Write the string representation of a double to the current result followed by a line terminator

static void NUnit.Framework.TestContext.WriteLine ( Int32  value)
inlinestatic

Write the string representation of an Int32 value to the current result followed by a line terminator

static void NUnit.Framework.TestContext.WriteLine ( Int64  value)
inlinestatic

Write the string representation of an Int64 value to the current result followed by a line terminator

static void NUnit.Framework.TestContext.WriteLine ( decimal  value)
inlinestatic

Write the string representation of a decimal value to the current result followed by a line terminator

static void NUnit.Framework.TestContext.WriteLine ( object  value)
inlinestatic

Write the string representation of an object to the current result followed by a line terminator

static void NUnit.Framework.TestContext.WriteLine ( Single  value)
inlinestatic

Write the string representation of a Single value to the current result followed by a line terminator

static void NUnit.Framework.TestContext.WriteLine ( string  value)
inlinestatic

Write a string to the current result followed by a line terminator

static void NUnit.Framework.TestContext.WriteLine ( UInt32  value)
inlinestatic

Write the string representation of a UInt32 value to the current result followed by a line terminator

static void NUnit.Framework.TestContext.WriteLine ( UInt64  value)
inlinestatic

Write the string representation of a UInt64 value to the current result followed by a line terminator

static void NUnit.Framework.TestContext.WriteLine ( string  format,
object  arg1 
)
inlinestatic

Write a formatted string to the current result followed by a line terminator

static void NUnit.Framework.TestContext.WriteLine ( string  format,
object  arg1,
object  arg2 
)
inlinestatic

Write a formatted string to the current result followed by a line terminator

static void NUnit.Framework.TestContext.WriteLine ( string  format,
object  arg1,
object  arg2,
object  arg3 
)
inlinestatic

Write a formatted string to the current result followed by a line terminator

static void NUnit.Framework.TestContext.WriteLine ( string  format,
params object[]  args 
)
inlinestatic

Write a formatted string to the current result followed by a line terminator

Member Data Documentation

readonly TestExecutionContext NUnit.Framework.TestContext._testExecutionContext
private
TestAdapter NUnit.Framework.TestContext._test
private
ResultAdapter NUnit.Framework.TestContext._result
private

Property Documentation

TestContext NUnit.Framework.TestContext.CurrentContext
staticget

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.

Referenced by NUnit.Engine.Services.Tests.DriverServiceTests.CorrectDriverIsUsed(), NUnit.Engine.Drivers.Tests.NUnit3FrameworkDriverTests.CreateDriver(), NUnit.Framework.Api.TestAssemblyRunnerTests.CreateRunner(), NUnit.Framework.Tests.Attributes.TestExpectedResult.ExpectedResultDoesNotBlockApplyToTestAttributes(), NUnit.Engine.Services.Tests.TestFilteringTests.LoadAssembly(), NUnit.TestData.TestContextData.TestTestContextInOneTimeTearDown.OneTimeTearDown(), NUnit.Framework.Tests.TestContextOneTimeTearDownTests.OneTimeTearDown(), NUnit.Engine.Services.Tests.DomainManagerStaticTests.ProperConfigFileIsUsed(), NUnit.TestData.TestContextData.TestStateRecordingFixture.SetUp(), NUnit.TestData.TestContextData.TestStateRecordingFixture.TearDown(), NUnit.TestData.TestContextData.TestTestContextInTearDown.TearDown(), NUnit.Framework.Tests.TestContextTearDownTests.TearDown(), NUnit.Framework.Tests.TestContextTests.TestCanAccessItsOwnFullName(), NUnit.Framework.Tests.TestContextTests.TestCanAccessItsOwnId(), NUnit.Framework.Tests.TestContextTests.TestCanAccessItsOwnMethodName(), NUnit.Framework.Tests.TestContextTests.TestCanAccessItsOwnName(), NUnit.Framework.Tests.TestContextTests.TestCanAccessItsOwnProperties(), NUnit.Framework.Tests.TestContextTests.TestCanAccessWorkDirectory(), NUnit.Framework.Tests.TestContextTests.TestCaseCanAccessItsOwnFullName(), NUnit.Framework.Tests.TestContextTests.TestCaseCanAccessItsOwnMethodName(), NUnit.Framework.Tests.TestContextTests.TestCaseCanAccessItsOwnName(), NUnit.Framework.Tests.TestContextTests.TestContextTests(), and NUnit.TestData.TestContextData.TestStateRecordingFixture.TheTest().

TextWriter NUnit.Framework.TestContext.Out
staticget

Gets a TextWriter that will send output to the current test result.

Referenced by NUnit.Framework.Tests.TestContextTests.TestContextOut_WritesToResult().

string NUnit.Framework.TestContext.WorkDirectory
get
Randomizer NUnit.Framework.TestContext.Random
get

Gets the random generator.

The random generator.


The documentation for this class was generated from the following file: