File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -12,13 +12,13 @@ public class ShoutoutCommand : IBasicCommand2
12
12
private readonly HttpClient _HttpClient ;
13
13
private readonly ILogger _Logger ;
14
14
15
- public ShoutoutCommand ( IHttpClientFactory httpClientFactory , ILogger logger )
15
+ public ShoutoutCommand ( IHttpClientFactory httpClientFactory , ILoggerFactory logger )
16
16
{
17
17
18
18
_HttpClient = httpClientFactory . CreateClient ( "ShoutoutCommand" ) ;
19
19
_HttpClient . BaseAddress = new Uri ( "https://api.twitch.tv/helix/users" ) ;
20
20
21
- _Logger = logger ;
21
+ _Logger = logger . CreateLogger ( nameof ( ShoutoutCommand ) ) ;
22
22
23
23
}
24
24
Original file line number Diff line number Diff line change @@ -18,14 +18,17 @@ public class ShoutoutCommandFixture
18
18
private readonly MockRepository _Mockery ;
19
19
private readonly Mock < IHttpClientFactory > _ClientFactory ;
20
20
private readonly Mock < IChatService > _ChatService ;
21
- private readonly ILogger _Logger ;
21
+ private readonly ILoggerFactory _Logger ;
22
22
23
23
public ShoutoutCommandFixture ( ITestOutputHelper output )
24
24
{
25
25
_Mockery = new MockRepository ( MockBehavior . Default ) ;
26
26
_ClientFactory = new Mock < IHttpClientFactory > ( ) ;
27
27
_ChatService = new Mock < IChatService > ( ) ;
28
- _Logger = new XunitLogger < ShoutoutCommand > ( output ) ;
28
+
29
+ var thisLogger = new Mock < ILoggerFactory > ( ) ;
30
+ thisLogger . Setup ( f => f . CreateLogger ( It . IsAny < string > ( ) ) ) . Returns ( new XunitLogger < ShoutoutCommand > ( output ) ) ;
31
+ _Logger = thisLogger . Object ;
29
32
30
33
}
31
34
You can’t perform that action at this time.
0 commit comments