File tree 2 files changed +13
-2
lines changed
Servers/IIS/IIS/test/IIS.Tests
2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 1
1
// Copyright (c) .NET Foundation. All rights reserved.
2
2
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3
3
4
+ using System . Linq ;
4
5
using System . Threading . Tasks ;
5
6
using Microsoft . AspNetCore . Testing ;
6
7
using Microsoft . Extensions . Logging ;
7
8
using Microsoft . Extensions . Logging . Testing ;
8
9
using Xunit ;
10
+ using Xunit . Sdk ;
9
11
10
12
namespace Microsoft . AspNetCore . Server . IIS . FunctionalTests
11
13
{
@@ -14,7 +16,11 @@ public class StrictTestServerTests: LoggedTest
14
16
public override void Dispose ( )
15
17
{
16
18
base . Dispose ( ) ;
17
- Assert . DoesNotContain ( TestSink . Writes , w => w . LogLevel > LogLevel . Information ) ;
19
+
20
+ if ( TestSink . Writes . FirstOrDefault ( w => w . LogLevel > LogLevel . Information ) is WriteContext writeContext )
21
+ {
22
+ throw new XunitException ( $ "Unexpected log: { writeContext } ") ;
23
+ }
18
24
}
19
25
20
26
protected static TaskCompletionSource < bool > CreateTaskCompletionSource ( )
Original file line number Diff line number Diff line change @@ -29,5 +29,10 @@ public string Message
29
29
return Formatter ( State , Exception ) ;
30
30
}
31
31
}
32
+
33
+ public override string ToString ( )
34
+ {
35
+ return $ "{ LogLevel } { LoggerName } : { Message } ";
36
+ }
32
37
}
33
- }
38
+ }
You can’t perform that action at this time.
0 commit comments