public void TimeoutSendingPausedNoAction_Data()
        {
            var bus = MockRepository.GenerateStrictMock <IBus>();

            var dataId          = Guid.NewGuid();
            var originalMessage = new ScheduleSmsForSendingLater {
                SmsData = new SmsData("3443", "message"), SmsMetaData = new SmsMetaData {
                    Tags = new List <string> {
                        "a", "b"
                    }, Topic = "topic"
                }
            };
            var data = new ScheduledSmsData {
                Id = dataId, OriginalMessage = originalMessage, SchedulingPaused = true
            };

            var scheduleSms = new ScheduleSms {
                Bus = bus, Data = data
            };
            var timeoutMessage = new ScheduleSmsTimeout();

            scheduleSms.Timeout(timeoutMessage);

            bus.VerifyAllExpectations();
        }
        public void TimeoutPromptsMessageSending_Data()
        {
            var bus = MockRepository.GenerateMock <IBus>();

            var sendOneMessageNow = new SendOneMessageNow();

            bus.Expect(b => b.Send(Arg <SendOneMessageNow> .Is.NotNull))
            .WhenCalled(i => sendOneMessageNow = (SendOneMessageNow)((i.Arguments[0])));

            var dataId          = Guid.NewGuid();
            var originalMessage = new ScheduleSmsForSendingLater {
                SmsData = new SmsData("3443", "message"), SmsMetaData = new SmsMetaData {
                    Tags = new List <string> {
                        "a", "b"
                    }, Topic = "topic"
                }
            };
            var data = new ScheduledSmsData {
                Id = dataId, OriginalMessage = originalMessage
            };

            var scheduleSms = new ScheduleSms {
                Bus = bus, Data = data
            };
            var timeoutMessage = new ScheduleSmsTimeout();

            scheduleSms.Timeout(timeoutMessage);

            Assert.That(sendOneMessageNow.SmsData, Is.EqualTo(data.OriginalMessage.SmsData));
            Assert.That(sendOneMessageNow.SmsMetaData, Is.EqualTo(data.OriginalMessage.SmsMetaData));
            Assert.That(sendOneMessageNow.CorrelationId, Is.EqualTo(data.Id));

            bus.VerifyAllExpectations();
        }
        public void TimeoutSendingPausedNoAction_Data()
        {
            var bus = MockRepository.GenerateStrictMock<IBus>();

            var dataId = Guid.NewGuid();
            var originalMessage = new ScheduleSmsForSendingLater { SmsData = new SmsData("3443", "message"), SmsMetaData = new SmsMetaData { Tags = new List<string> { "a", "b" }, Topic = "topic" } };
            var data = new ScheduledSmsData { Id = dataId, OriginalMessage = originalMessage, SchedulingPaused = true };

            var scheduleSms = new ScheduleSms { Bus = bus, Data = data };
            var timeoutMessage = new ScheduleSmsTimeout();
            scheduleSms.Timeout(timeoutMessage);

            bus.VerifyAllExpectations();
        }
        public void TimeoutPromptsMessageSending_Data()
        {
            var bus = MockRepository.GenerateMock<IBus>();

            var sendOneMessageNow = new SendOneMessageNow();
            bus.Expect(b => b.Send(Arg<SendOneMessageNow>.Is.NotNull))
                .WhenCalled(i => sendOneMessageNow = (SendOneMessageNow)((object[])(i.Arguments[0]))[0]);

            var dataId = Guid.NewGuid();
            var originalMessage = new ScheduleSmsForSendingLater { SmsData = new SmsData("3443", "message"), SmsMetaData = new SmsMetaData { Tags = new List<string> { "a", "b" }, Topic = "topic" } };
            var data = new ScheduledSmsData { Id = dataId, OriginalMessage = originalMessage};

            var scheduleSms = new ScheduleSms { Bus = bus, Data = data };
            var timeoutMessage = new ScheduleSmsTimeout();
            scheduleSms.Timeout(timeoutMessage);

            Assert.That(sendOneMessageNow.SmsData, Is.EqualTo(data.OriginalMessage.SmsData));
            Assert.That(sendOneMessageNow.SmsMetaData, Is.EqualTo(data.OriginalMessage.SmsMetaData));
            Assert.That(sendOneMessageNow.CorrelationId, Is.EqualTo(data.Id));

            bus.VerifyAllExpectations();
        }