public void Send()
        {
            var stream = new MemoryStream();
            var sender = new Mock<IReportSender>();
            {
                sender.Setup(s => s.SendReport(It.IsAny<Stream>()))
                    .Callback<Stream>(s => Assert.AreSame(stream, s))
                    .Verifiable();
            }

            var transmitter = new FeedbackReportTransmitter(sender.Object);
            transmitter.Send(stream);

            sender.Verify(s => s.SendReport(It.IsAny<Stream>()), Times.Once());
        }
        public void SendWithError()
        {
            var stream = new MemoryStream();
            var sender = new Mock<IReportSender>();
            {
                sender.Setup(s => s.SendReport(It.IsAny<Stream>()))
                    .Callback<Stream>(s =>
                    {
                        throw new CouldNotConnectToTheRemoteServiceException();
                    })
                    .Verifiable();
            }

            var transmitter = new FeedbackReportTransmitter(sender.Object);
            Assert.Throws<FailedToSendFeedbackReportException>(() => transmitter.Send(stream));
        }
        public void Send()
        {
            var stream = new MemoryStream();
            var sender = new Mock <IReportSender>();
            {
                sender.Setup(s => s.SendReport(It.IsAny <Stream>()))
                .Callback <Stream>(s => Assert.AreSame(stream, s))
                .Verifiable();
            }

            var transmitter = new FeedbackReportTransmitter(sender.Object);

            transmitter.Send(stream);

            sender.Verify(s => s.SendReport(It.IsAny <Stream>()), Times.Once());
        }
        public void SendWithError()
        {
            var stream = new MemoryStream();
            var sender = new Mock <IReportSender>();
            {
                sender.Setup(s => s.SendReport(It.IsAny <Stream>()))
                .Callback <Stream>(s =>
                {
                    throw new CouldNotConnectToTheRemoteServiceException();
                })
                .Verifiable();
            }

            var transmitter = new FeedbackReportTransmitter(sender.Object);

            Assert.Throws <FailedToSendFeedbackReportException>(() => transmitter.Send(stream));
        }