1
+ using System . Reflection ;
2
+ using AStar . Dev . Logging . Extensions ;
3
+ using JetBrains . Annotations ;
4
+ using Microsoft . Extensions . Logging ;
5
+ using Microsoft . Extensions . Logging . Abstractions ;
6
+ using Xunit . Abstractions ;
7
+
8
+ namespace AStar . Dev . Logging . Extensions ;
9
+
10
+ [ TestSubject ( typeof ( LoggerMessageDefinitionsApi ) ) ]
11
+ public class LoggerMessageDefinitionsApiShould
12
+ {
13
+ [ Fact ]
14
+ public void DefineTheHealthCheckFailureMessageAsExpected ( )
15
+ {
16
+ var healthCheckFailure = LoggerMessageDefinitionsApi . HealthCheckFailure ;
17
+
18
+ healthCheckFailure . Method . ToString ( ) . ShouldBe ( "Void <Define>b__1(Microsoft.Extensions.Logging.ILogger, System.String, System.String, System.Exception)" ) ;
19
+ healthCheckFailure . Target ? . ToString ( ) . ShouldBe ( "Microsoft.Extensions.Logging.LoggerMessage+<>c__DisplayClass12_0`2[System.String,System.String]" ) ;
20
+ }
21
+
22
+ [ Fact ]
23
+ public void DefineTheHealthCheckStartMessageAsExpected ( )
24
+ {
25
+ var healthCheckStart = LoggerMessageDefinitionsApi . HealthCheckStart ;
26
+
27
+ healthCheckStart . Method . ToString ( ) . ShouldBe ( "Void <Define>b__1(Microsoft.Extensions.Logging.ILogger, System.String, System.Exception)" ) ;
28
+ healthCheckStart . Target ? . ToString ( ) . ShouldBe ( "Microsoft.Extensions.Logging.LoggerMessage+<>c__DisplayClass10_0`1[System.String]" ) ;
29
+ }
30
+
31
+ [ Fact ]
32
+ public void DefineTheHealthCheckSuccessMessageAsExpected ( )
33
+ {
34
+ var healthCheckSuccess = LoggerMessageDefinitionsApi . HealthCheckSuccess ;
35
+
36
+ healthCheckSuccess . Method . ToString ( ) . ShouldBe ( "Void <Define>b__1(Microsoft.Extensions.Logging.ILogger, System.String, System.Exception)" ) ;
37
+ healthCheckSuccess . Target ? . ToString ( ) . ShouldBe ( "Microsoft.Extensions.Logging.LoggerMessage+<>c__DisplayClass10_0`1[System.String]" ) ;
38
+ }
39
+
40
+ [ Fact ]
41
+ public void DefineTheHealthCheckWarningMessageAsExpected ( )
42
+ {
43
+ var healthCheckWarning = LoggerMessageDefinitionsApi . HealthCheckWarning ;
44
+
45
+ healthCheckWarning . Method . ToString ( ) . ShouldBe ( "Void <Define>b__1(Microsoft.Extensions.Logging.ILogger, System.String, System.String, System.Exception)" ) ;
46
+ healthCheckWarning . Target ? . ToString ( ) . ShouldBe ( "Microsoft.Extensions.Logging.LoggerMessage+<>c__DisplayClass12_0`2[System.String,System.String]" ) ;
47
+ }
48
+
49
+ [ Fact ]
50
+ public void DefineTheApiCallFailureMessageAsExpected ( )
51
+ {
52
+ var apiCallFailure = LoggerMessageDefinitionsApi . ApiCallFailure ;
53
+
54
+ apiCallFailure . Method . ToString ( ) . ShouldBe ( "Void <Define>b__1(Microsoft.Extensions.Logging.ILogger, System.String, System.String, System.String, System.Exception)" ) ;
55
+ apiCallFailure . Target ? . ToString ( ) . ShouldBe ( "Microsoft.Extensions.Logging.LoggerMessage+<>c__DisplayClass14_0`3[System.String,System.String,System.String]" ) ;
56
+ }
57
+
58
+ [ Fact ]
59
+ public void DefineTheApiCallStartMessageAsExpected ( )
60
+ {
61
+ var apiCallStart = LoggerMessageDefinitionsApi . ApiCallStart ;
62
+
63
+ apiCallStart . Method . ToString ( ) . ShouldBe ( "Void <Define>b__1(Microsoft.Extensions.Logging.ILogger, System.String, System.String, System.Exception)" ) ;
64
+ apiCallStart . Target ? . ToString ( ) . ShouldBe ( "Microsoft.Extensions.Logging.LoggerMessage+<>c__DisplayClass12_0`2[System.String,System.String]" ) ;
65
+ }
66
+
67
+ [ Fact ]
68
+ public void DefineTheApiCallSuccessMessageAsExpected ( )
69
+ {
70
+ var apiCallSuccess = LoggerMessageDefinitionsApi . ApiCallSuccess ;
71
+
72
+ apiCallSuccess . Method . ToString ( ) . ShouldBe ( "Void <Define>b__1(Microsoft.Extensions.Logging.ILogger, System.String, System.String, System.Exception)" ) ;
73
+ apiCallSuccess . Target ? . ToString ( ) . ShouldBe ( "Microsoft.Extensions.Logging.LoggerMessage+<>c__DisplayClass12_0`2[System.String,System.String]" ) ;
74
+ }
75
+
76
+ [ Fact ]
77
+ public void DefineTheApiCallWarningMessageAsExpected ( )
78
+ {
79
+ var apiCallWarning = LoggerMessageDefinitionsApi . ApiCallWarning ;
80
+
81
+ apiCallWarning . Method . ToString ( ) . ShouldBe ( "Void <Define>b__1(Microsoft.Extensions.Logging.ILogger, System.String, System.String, System.String, System.Exception)" ) ;
82
+ apiCallWarning . Target ? . ToString ( ) . ShouldBe ( "Microsoft.Extensions.Logging.LoggerMessage+<>c__DisplayClass14_0`3[System.String,System.String,System.String]" ) ;
83
+ }
84
+ }
0 commit comments