Exemple #1
0
        public void ThrowArgumentNullException_WhenContentIsEmpty(Protocol.TransferProtocolSender protocol, TransferProtocolVefify protocolVerify)
        {
            Func <Task> action = () => protocol.Send(_uri, new byte[0]);

            action.Should().Throw <ArgumentNullException>();
        }
Exemple #2
0
        public void ThrowArgumentNullException_WhenUriIsEmpty(Protocol.TransferProtocolSender protocol, TransferProtocolVefify protocolVerify)
        {
            Func <Task> action = () => protocol.Send(string.Empty, new byte[1]);

            action.Should().Throw <ArgumentNullException>();
        }
Exemple #3
0
        public async Task ReturnTheResponse(Protocol.TransferProtocolSender protocol, TransferProtocolVefify protocolVerify)
        {
            protocolVerify.SetupResponse(_anyObject);
            var responseBytes = await protocol.Send(_uri, _anyByte);

            var response = TestSerializer.Deserialize <AnyObject>(responseBytes);

            response.Should().BeOfType <AnyObject>();
            response.anyInt.Should().Be(_anyObject.anyInt);
            response.anyString.Should().Be(_anyObject.anyString);
        }
Exemple #4
0
        public async Task SendTheContent(Protocol.TransferProtocolSender protocol, TransferProtocolVefify protocolVerify)
        {
            await protocol.Send(_uri, TestSerializer.Serialize(_anyObject));

            protocolVerify.Content <AnyObject>(_anyObject);
        }
Exemple #5
0
        public async Task SendToTheUri(Protocol.TransferProtocolSender protocol, TransferProtocolVefify protocolVerify)
        {
            await protocol.Send(_uri, _anyByte);

            protocolVerify.Uri(_uri);
        }