NUnit.Framework.TestContext
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 NUnit.Framework
{
public class TestContext
{
public class TestAdapter
{
public string ID { get; }
public string Name { get; }
public string Namespace { get; }
public string DisplayName { get; }
public string MethodName { get; }
public IMethodInfo Method { get; }
public Type Type { get; }
public string FullName { get; }
public string ClassName { get; }
public PropertyBagAdapter Properties { get; }
public object[] Arguments { get; }
public object ExpectedResult { get; }
public ITest Parent { get; }
public TestAdapter(Test test);
public IDictionary<PropertyHierachyItem, IList> PropertyHierarchy();
public IEnumerable<object> AllPropertyValues(string property);
public IEnumerable<string> AllCategories();
}
public class PropertyHierachyItem
{
public string Name { get; }
public string Level { get; }
public PropertyHierachyItem();
public PropertyHierachyItem(string name, string level);
}
public class PropertyValueHierarchyItem
{
public IList Values { get; set; }
public string Level { get; set; }
public PropertyValueHierarchyItem(string testName, IList propValues);
}
public class ResultAdapter
{
public ResultState Outcome { get; }
public IEnumerable<AssertionResult> Assertions { get; }
public string Message { get; }
public virtual string StackTrace { get; }
public int FailCount { get; }
public int WarningCount { get; }
public int PassCount { get; }
public int SkipCount { get; }
public int InconclusiveCount { get; }
public ResultAdapter(TestResult result);
}
public class PropertyBagAdapter
{
public IEnumerable<object> this[string key] {
[IteratorStateMachine(typeof(<get_Item>d__5))]
get;
}
public ICollection<string> Keys { get; }
public PropertyBagAdapter(IPropertyBag source);
public object Get(string key);
public bool ContainsKey(string key);
public int Count(string key);
}
public static TextWriter Error;
public static readonly TextWriter Progress;
public static readonly TestParameters Parameters;
public static TestContext CurrentContext { get; }
public static TextWriter Out { get; }
public TestAdapter Test { get; }
public ResultAdapter Result { get; }
public string WorkerId { get; }
public string TestDirectory { get; }
public string WorkDirectory { get; }
public Randomizer Random { get; }
public int AssertCount { get; }
public int CurrentRepeatCount { get; }
public CancellationToken CancellationToken { get; }
public TestContext(TestExecutionContext testExecutionContext);
public static void Write(bool value);
public static void Write(char value);
public static void Write(char[] value);
public static void Write(double value);
public static void Write(int value);
public static void Write(long value);
public static void Write(decimal value);
public static void Write(object value);
public static void Write(float value);
public static void Write(string value);
public static void Write(uint value);
public static void Write(ulong value);
public static void Write(string format, object arg1);
public static void Write(string format, object arg1, object arg2);
public static void Write(string format, object arg1, object arg2, object arg3);
public static void Write(string format, params object[] args);
public static void WriteLine();
public static void WriteLine(bool value);
public static void WriteLine(char value);
public static void WriteLine(char[] value);
public static void WriteLine(double value);
public static void WriteLine(int value);
public static void WriteLine(long value);
public static void WriteLine(decimal value);
public static void WriteLine(object value);
public static void WriteLine(float value);
public static void WriteLine(string value);
public static void WriteLine(uint value);
public static void WriteLine(ulong value);
public static void WriteLine(string format, object arg1);
public static void WriteLine(string format, object arg1, object arg2);
public static void WriteLine(string format, object arg1, object arg2, object arg3);
public static void WriteLine(string format, params object[] args);
public static void AddFormatter(ValueFormatterFactory formatterFactory);
public static void AddTestAttachment(string filePath, string description = null);
public static void AddFormatter<[System.Runtime.CompilerServices.Nullable(2)] TSupported>(ValueFormatter formatter);
}
}