public void ReturnBytes(nRpc.Serializer serializer) { var result = serializer.Serialize(new AnyObject()); result.Should().NotBeNull(); result.Length.Should().NotBe(0); }
public void ReturnType(nRpc.Serializer serializer) { var serialized = serializer.Serialize(new AnyObject()); var result = serializer.Deserialize <AnyObject>(serialized); result.Should().BeOfType <AnyObject>(); result.Should().NotBeNull(); }
public async Task ReturnTheResponseMessage() { var protocolMock = new Mock <Protocol.TransferProtocolSender>(); protocolMock.Setup(p => p.Send(It.IsAny <string>(), It.IsAny <byte[]>())).ReturnsAsync(TestSerializer.Serialize(_anyObject)); var client = new nRpc.Client(_hostUri, protocolMock.Object, TestSerializer); var response = await client.Call(new Procedure <object, AnyObject>("AnyName") , new object()); response.Should().BeOfType <AnyObject>(); response.anyInt.Should().Be(_anyObject.anyInt); response.anyString.Should().Be(_anyObject.anyString); }
public void ThrowArgumentNullException_WhenObjectIsNull(nRpc.Serializer serializer) { Action action = () => serializer.Serialize(null); action.Should().Throw <ArgumentNullException>(); }