public void ServerProxy_ExecuteCommand_WhenNullPayload_ExceptionThrown()
        {
            //------------Setup for test--------------------------
            var serverProxy = new TestServerProxyWithChunking();

            //------------Execute Test---------------------------
            serverProxy.ExecuteCommand(null, Guid.NewGuid());
            //------------Assert Results-------------------------
        }
        public void ServerProxy_ExecuteCommand_WithArgs_ShouldInvokeCorrectly()
        {
            //------------Setup for test--------------------------
            const string ServerMsg      = "server result";
            var          mockHubProxy   = new Mock <IHubProxyWrapper>();
            var          expectedResult = new Receipt {
                PartID = 0, ResultParts = 1
            };

            mockHubProxy.Setup(proxy => proxy.Invoke <Receipt>("ExecuteCommand", It.IsAny <Envelope>(), It.IsAny <bool>(), It.IsAny <Guid>(), It.IsAny <Guid>(), It.IsAny <Guid>())).Returns(new Task <Receipt>(() => expectedResult));
            mockHubProxy.Setup(proxy => proxy.Invoke <string>("FetchExecutePayloadFragment", It.IsAny <FutureReceipt>())).Returns(new Task <string>(() => ServerMsg));
            var serverProxy = new TestServerProxyWithChunking();

            serverProxy.SetEsbProxy(mockHubProxy.Object);
            //------------Execute Test---------------------------
            var resultOfExecution = serverProxy.ExecuteCommand(new StringBuilder("some payload"), Guid.NewGuid());

            //------------Assert Results-------------------------
            mockHubProxy.VerifyAll();
            Assert.AreEqual(ServerMsg, resultOfExecution.ToString());
        }