diff --git a/test/Microsoft.TestPlatform.CommunicationUtilities.Platform.UnitTests/SocketClientTests.cs b/test/Microsoft.TestPlatform.CommunicationUtilities.Platform.UnitTests/SocketClientTests.cs index 2461db6029..91b2e826f4 100644 --- a/test/Microsoft.TestPlatform.CommunicationUtilities.Platform.UnitTests/SocketClientTests.cs +++ b/test/Microsoft.TestPlatform.CommunicationUtilities.Platform.UnitTests/SocketClientTests.cs @@ -83,7 +83,7 @@ public void SocketClientStartShouldThrowIfServerIsNotListening() [TestMethod] public void SocketClientStopShouldRaiseClientDisconnectedEventOnClientDisconnection() { - var waitEvent = SetupClientDisconnect(out ICommunicationChannel _); + var waitEvent = SetupClientDisconnect(out ICommunicationChannel? _); // Close the communication from client side _socketClient.Stop(); @@ -94,7 +94,7 @@ public void SocketClientStopShouldRaiseClientDisconnectedEventOnClientDisconnect [TestMethod] public void SocketClientShouldRaiseClientDisconnectedEventIfConnectionIsBroken() { - var waitEvent = SetupClientDisconnect(out ICommunicationChannel _); + var waitEvent = SetupClientDisconnect(out ICommunicationChannel? _); // Close the communication from server side _tcpClient?.GetStream().Dispose(); @@ -106,7 +106,7 @@ public void SocketClientShouldRaiseClientDisconnectedEventIfConnectionIsBroken() [TestMethod] public void SocketClientStopShouldStopCommunication() { - var waitEvent = SetupClientDisconnect(out ICommunicationChannel _); + var waitEvent = SetupClientDisconnect(out ICommunicationChannel? _); // Close the communication from socket client side _socketClient.Stop(); @@ -157,7 +157,7 @@ private ManualResetEvent SetupClientDisconnect(out ICommunicationChannel? channe { var waitEvent = new ManualResetEvent(false); _socketClient.Disconnected += (s, e) => waitEvent.Set(); - channel = SetupChannel(out ConnectedEventArgs _); + channel = SetupChannel(out ConnectedEventArgs? _); channel!.MessageReceived += (sender, args) => { }; diff --git a/test/Microsoft.TestPlatform.CommunicationUtilities.Platform.UnitTests/SocketServerTests.cs b/test/Microsoft.TestPlatform.CommunicationUtilities.Platform.UnitTests/SocketServerTests.cs index ac1b866a77..b64a9e4304 100644 --- a/test/Microsoft.TestPlatform.CommunicationUtilities.Platform.UnitTests/SocketServerTests.cs +++ b/test/Microsoft.TestPlatform.CommunicationUtilities.Platform.UnitTests/SocketServerTests.cs @@ -140,7 +140,7 @@ public void SocketServerShouldRaiseClientDisconnectedEventIfConnectionIsBroken() [TestMethod] public async Task SocketEndpointShouldInitializeChannelOnServerConnection() { - var channel = SetupChannel(out ConnectedEventArgs _); + var channel = SetupChannel(out ConnectedEventArgs? _); await channel!.Send(Dummydata);