TestContext.Write Method

Definition

Overloads

Write(String)

Used to write trace messages while the test is running

Write(String, Object[])

Used to write trace messages while the test is running

Write(String)

Source:
TestContext.cs
Source:
TestContext.cs
Source:
TestContext.cs
Source:
TestContext.cs
Source:
TestContext.cs
Source:
TestContext.cs
Source:
TestContext.cs
Source:
TestContext.cs

Used to write trace messages while the test is running

C#
public abstract void Write(string message);
C#
public abstract void Write(string? message);

Parameters

message
String

formatted message string

Applies to

MSTest.TestFramework 3.8.0 and other versions
Product Versions
MSTest.TestFramework 2.1.2, 2.2.10, 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.0

Write(String, Object[])

Source:
TestContext.cs
Source:
TestContext.cs
Source:
TestContext.cs
Source:
TestContext.cs
Source:
TestContext.cs
Source:
TestContext.cs
Source:
TestContext.cs
Source:
TestContext.cs

Used to write trace messages while the test is running

C#
public abstract void Write(string format, params object[] args);
C#
public abstract void Write(string format, params object?[] args);

Parameters

format
String

format string

args
Object[]

the arguments

Applies to

MSTest.TestFramework 3.8.0 and other versions
Product Versions
MSTest.TestFramework 2.1.2, 2.2.10, 3.0.4, 3.1.1, 3.2.2, 3.3.1, 3.4.3, 3.5.1, 3.6.4, 3.7.3, 3.8.0