private static async Task RpcSendAsyncTimeOut(IRemote remote) { TestPacket1 packet2 = new TestPacket1() { Value = new Random().Next() }; var(result, exception) = await remote.SendAsync <TestPacket2>(packet2); Assert.AreEqual(typeof(TimeoutException), exception.GetType()); Assert.AreEqual(null, result); }
private static async Task RpcSendAsyncTypeError(IRemote remote) { TestPacket2 packet2 = new TestPacket2() { Value = new Random().Next() }; var(result, exception) = await remote.SendAsync <TestPacket1>(packet2); Assert.AreEqual(typeof(InvalidCastException), exception.GetType()); Assert.AreEqual(null, result); }
private static async Task RpcSendAsync(IRemote remote) { TestPacket2 packet2 = new TestPacket2() { Value = new Random().Next() }; var(result, exception) = await remote.SendAsync <TestPacket2>(packet2); Assert.AreEqual(null, exception); Assert.AreEqual(packet2.Value, result.Value); }