forked from SimonCropp/XunitContext
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ContextSample.cs
43 lines (30 loc) · 929 Bytes
/
ContextSample.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using Xunit;
using Xunit.Abstractions;
public class ContextSample :
XunitLoggingBase
{
[Fact]
public void Usage()
{
var currentGuid = Context.CurrentGuid;
var nextGuid = Context.NextGuid();
Context.WriteLine("Some message");
var currentLogMessages = Context.LogMessages;
var testOutputHelper = Context.TestOutput;
var currentTest = Context.Test;
}
[Fact]
public void StaticUsage()
{
var currentGuid = XunitLogging.Context.CurrentGuid;
var nextGuid = XunitLogging.Context.NextGuid();
XunitLogging.Context.WriteLine("Some message");
var currentLogMessages = XunitLogging.Context.LogMessages;
var testOutputHelper = XunitLogging.Context.TestOutput;
var currentTest = XunitLogging.Context.Test;
}
public ContextSample(ITestOutputHelper output) :
base(output)
{
}
}