File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
Servers/IIS/IIS/test/IIS.Tests Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 11// Copyright (c) .NET Foundation. All rights reserved.
22// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33
4+ using System . Linq ;
45using System . Threading . Tasks ;
56using Microsoft . AspNetCore . Testing ;
67using Microsoft . Extensions . Logging ;
78using Microsoft . Extensions . Logging . Testing ;
89using Xunit ;
10+ using Xunit . Sdk ;
911
1012namespace Microsoft . AspNetCore . Server . IIS . FunctionalTests
1113{
@@ -14,7 +16,11 @@ public class StrictTestServerTests: LoggedTest
1416 public override void Dispose ( )
1517 {
1618 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+ }
1824 }
1925
2026 protected static TaskCompletionSource < bool > CreateTaskCompletionSource ( )
Original file line number Diff line number Diff line change @@ -29,5 +29,10 @@ public string Message
2929 return Formatter ( State , Exception ) ;
3030 }
3131 }
32+
33+ public override string ToString ( )
34+ {
35+ return $ "{ LogLevel } { LoggerName } : { Message } ";
36+ }
3237 }
33- }
38+ }
You can’t perform that action at this time.
0 commit comments