Skip to content

Commit

Permalink
removing sendAsync from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Frowen committed Mar 7, 2021
1 parent 6abdd02 commit ab591a4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions Assets/Tests/Runtime/Serializers/NetworkConnectionTest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using NSubstitute;
using NUnit.Framework;
Expand Down Expand Up @@ -38,7 +38,7 @@ void ParsePacket(ArraySegment<byte> data)
Array.Copy(data.Array, data.Offset, lastSerializedPacket, 0, data.Count);
}

mockTransportConnection.SendAsync(
mockTransportConnection.Send(
Arg.Do<ArraySegment<byte>>(ParsePacket), Channel.Unreliable);

connection = new NetworkConnection(mockTransportConnection);
Expand Down Expand Up @@ -271,4 +271,4 @@ public void NotAcknowledgedYet()

#endregion
}
}
}
12 changes: 6 additions & 6 deletions Assets/Tests/Runtime/Transport/KcpTransportTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public void Connect()
[UnityTest]
public IEnumerator SendDataFromClient() => UniTask.ToCoroutine(async () =>
{
await clientConnection.SendAsync(new ArraySegment<byte>(data));
clientConnection.Send(new ArraySegment<byte>(data));
var buffer = new MemoryStream();
await serverConnection.ReceiveAsync(buffer);
Expand All @@ -102,7 +102,7 @@ public void Connect()
[UnityTest]
public IEnumerator SendDataFromServer() => UniTask.ToCoroutine(async () =>
{
await serverConnection.SendAsync(new ArraySegment<byte>(data));
serverConnection.Send(new ArraySegment<byte>(data));
var buffer = new MemoryStream();
await clientConnection.ReceiveAsync(buffer);
Expand All @@ -115,7 +115,7 @@ public void Connect()
long received = transport.ReceivedBytes;
Assert.That(received, Is.GreaterThan(0), "Must have received some bytes to establish the connection");
await clientConnection.SendAsync(new ArraySegment<byte>(data));
clientConnection.Send(new ArraySegment<byte>(data));
var buffer = new MemoryStream();
await serverConnection.ReceiveAsync(buffer);
Expand All @@ -130,7 +130,7 @@ public void Connect()
long sent = transport.SentBytes;
Assert.That(sent, Is.GreaterThan(0), "Must have received some bytes to establish the connection");
await serverConnection.SendAsync(new ArraySegment<byte>(data));
serverConnection.Send(new ArraySegment<byte>(data));
var buffer = new MemoryStream();
await clientConnection.ReceiveAsync(buffer);
Expand All @@ -142,7 +142,7 @@ public void Connect()
[UnityTest]
public IEnumerator SendUnreliableDataFromServer() => UniTask.ToCoroutine(async () =>
{
await serverConnection.SendAsync(new ArraySegment<byte>(data), Channel.Unreliable);
serverConnection.Send(new ArraySegment<byte>(data), Channel.Unreliable);
var buffer = new MemoryStream();
int channel = await clientConnection.ReceiveAsync(buffer);
Expand All @@ -153,7 +153,7 @@ public void Connect()
[UnityTest]
public IEnumerator SendUnreliableDataFromClient() => UniTask.ToCoroutine(async () =>
{
await clientConnection.SendAsync(new ArraySegment<byte>(data), Channel.Unreliable);
clientConnection.Send(new ArraySegment<byte>(data), Channel.Unreliable);
var buffer = new MemoryStream();
int channel = await serverConnection.ReceiveAsync(buffer);
Expand Down
8 changes: 4 additions & 4 deletions Assets/Tests/Runtime/Transport/TransportTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public TransportTests(string[] scheme, string uri, int port)
Encoding utf8 = Encoding.UTF8;
string message = "Hello from the client";
byte[] data = utf8.GetBytes(message);
await clientConnection.SendAsync(new ArraySegment<byte>(data));
clientConnection.Send(new ArraySegment<byte>(data));
var stream = new MemoryStream();
Expand Down Expand Up @@ -107,11 +107,11 @@ public void EndpointAddress()
Encoding utf8 = Encoding.UTF8;
string message = "Hello from the client 1";
byte[] data = utf8.GetBytes(message);
await clientConnection.SendAsync(new ArraySegment<byte>(data));
clientConnection.Send(new ArraySegment<byte>(data));
string message2 = "Hello from the client 2";
byte[] data2 = utf8.GetBytes(message2);
await clientConnection.SendAsync(new ArraySegment<byte>(data2));
clientConnection.Send(new ArraySegment<byte>(data2));
var stream = new MemoryStream();
Expand All @@ -131,7 +131,7 @@ public void EndpointAddress()
Encoding utf8 = Encoding.UTF8;
string message = "Hello from the server";
byte[] data = utf8.GetBytes(message);
await serverConnection.SendAsync(new ArraySegment<byte>(data));
serverConnection.Send(new ArraySegment<byte>(data));
var stream = new MemoryStream();
Expand Down

0 comments on commit ab591a4

Please sign in to comment.