11using System ;
22using System . Diagnostics ;
3- using System . Linq ;
43using System . Net ;
54using System . Net . Sockets ;
65using System . Threading . Tasks ;
@@ -15,7 +14,10 @@ namespace Serilog.Sinks.Network.Test
1514{
1615 public class JsonFormatter
1716 {
18- private static LoggerAndSocket ConfigureTestLogger ( ITextFormatter ? formatter = null , ILogEventEnricher [ ] ? enrichers = null )
17+ private static LoggerAndSocket ConfigureTestLogger (
18+ ITextFormatter formatter = null ,
19+ ILogEventEnricher [ ] enrichers = null
20+ )
1921 {
2022 var socket = new Socket ( AddressFamily . InterNetwork , SocketType . Stream , ProtocolType . Tcp ) ;
2123 socket . Bind ( new IPEndPoint ( IPAddress . Loopback , 0 ) ) ;
@@ -67,7 +69,7 @@ public async Task IncludesCurrentActivityTraceAndSpanIds()
6769 // StartActivity() would return null if there were no listeners.
6870 using var activitySource = new ActivitySource ( "TestSource" ) ;
6971 using var activityListener = CreateAndAddActivityListener ( activitySource . Name ) ;
70- using Activity ? activity = activitySource . StartActivity ( ) ;
72+ using var activity = activitySource . StartActivity ( ) ;
7173 Assert . NotNull ( activity ) ;
7274
7375 using var fixture = ConfigureTestLogger ( new LogstashJsonFormatter ( ) ) ;
@@ -98,7 +100,7 @@ public async Task DoesNotAddDuplicateTraceAndSpanIds()
98100 {
99101 using var activitySource = new ActivitySource ( "TestSource" ) ;
100102 using var activityListener = CreateAndAddActivityListener ( activitySource . Name ) ;
101- using Activity ? activity = activitySource . StartActivity ( ) ;
103+ using var activity = activitySource . StartActivity ( ) ;
102104 Assert . NotNull ( activity ) ;
103105
104106 using var fixture = ConfigureTestLogger (
0 commit comments