-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tests.cs
53 lines (42 loc) · 991 Bytes
/
Tests.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
44
45
46
47
48
49
50
51
52
53
public class Tests
{
#region Usage
[Fact]
public Task Usage()
{
Recording.Start();
var result = Method();
return Verify(result);
}
static string Method()
{
Log.Error("The Message");
return "Result";
}
#endregion
[Fact]
public Task Empty()
{
Recording.Start();
return Verify("Result");
}
[Fact]
public Task ScalarValueGuid() =>
Verify(new ScalarValue(Guid.NewGuid()));
[Fact]
public Task ForContext()
{
Recording.Start();
var logger = Log.ForContext("key", "value");
logger.Error("The Message");
return Verify("Result");
}
[Fact]
public Task DictionaryValue() =>
Verify(
new DictionaryValue(
new List<KeyValuePair<ScalarValue, LogEventPropertyValue>>
{
new(new(Guid.NewGuid()), new ScalarValue("value"))
}));
}