From 0f547f8d0b88e4c6ab9968be7428187fb85e91a2 Mon Sep 17 00:00:00 2001 From: James Frowen Date: Tue, 9 Jul 2024 19:45:50 +0100 Subject: [PATCH] test: updating exception in SocketLayer tests --- .../Tests/SocketLayer/AckSystem/AckSystemTest_BufferSize.cs | 6 +++--- .../Tests/SocketLayer/AckSystem/NoReliableConnectionTest.cs | 2 +- Assets/Tests/SocketLayer/PeerTestSendReceive.cs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Assets/Tests/SocketLayer/AckSystem/AckSystemTest_BufferSize.cs b/Assets/Tests/SocketLayer/AckSystem/AckSystemTest_BufferSize.cs index ee040329628..663ad4a85c7 100644 --- a/Assets/Tests/SocketLayer/AckSystem/AckSystemTest_BufferSize.cs +++ b/Assets/Tests/SocketLayer/AckSystem/AckSystemTest_BufferSize.cs @@ -28,7 +28,7 @@ public void ThrowsIfTooManyMessageAreSent() instance.ackSystem.Update(); } - var exception = Assert.Throws(() => + var exception = Assert.Throws(() => { instance.ackSystem.SendReliable(createRandomData(51)); instance.ackSystem.Update(); @@ -59,12 +59,12 @@ public void ThrowIfRingBufferIsfull() instance.ackSystem.Update(); } - var exception = Assert.Throws(() => + var exception = Assert.Throws(() => { instance.ackSystem.SendReliable(createRandomData(0)); instance.ackSystem.Update(); }); - var expected = new InvalidOperationException($"Sent queue is full for {instance.connection}"); + var expected = new BufferFullException($"Sent queue is full for {instance.connection}"); Assert.That(exception, Has.Message.EqualTo(expected.Message)); } } diff --git a/Assets/Tests/SocketLayer/AckSystem/NoReliableConnectionTest.cs b/Assets/Tests/SocketLayer/AckSystem/NoReliableConnectionTest.cs index 9bb8ecdacfa..f9a222d485e 100644 --- a/Assets/Tests/SocketLayer/AckSystem/NoReliableConnectionTest.cs +++ b/Assets/Tests/SocketLayer/AckSystem/NoReliableConnectionTest.cs @@ -63,7 +63,7 @@ public void ThrowsIfTooBig() // 3 byte header, so max size is over max var bigBuffer = new byte[MAX_PACKET_SIZE - 2]; - var exception = Assert.Throws(() => + var exception = Assert.Throws(() => { _connection.SendReliable(bigBuffer); }); diff --git a/Assets/Tests/SocketLayer/PeerTestSendReceive.cs b/Assets/Tests/SocketLayer/PeerTestSendReceive.cs index 5e3f76d116d..e172e4e57e1 100644 --- a/Assets/Tests/SocketLayer/PeerTestSendReceive.cs +++ b/Assets/Tests/SocketLayer/PeerTestSendReceive.cs @@ -325,7 +325,7 @@ public void FragmentedSendThrowsIfTooBig() { var message = Enumerable.Range(10, maxFragmentMessageSize + 1).Select(x => (byte)x).ToArray(); - Assert.Throws(() => + Assert.Throws(() => { serverConnections[0].SendReliable(message); });