public EmailStatusUpdate(SendOneEmailNow originalMessage, string emailId)
 {
     EmailId = emailId;
     ToAddress = originalMessage.ToAddress;
     FromAddress = originalMessage.FromAddress;
     FromDisplayName = originalMessage.FromDisplayName;
     ReplyToAddress = originalMessage.ReplyToAddress;
     Subject = originalMessage.Subject;
     BodyHtml = originalMessage.BodyHtml;
     BodyText = originalMessage.BodyText;
     CorrelationId = originalMessage.CorrelationId;
     // TODO: Do we need email confrmation?
     //ConfirmationEmailAddress = originalMessage
     Username = originalMessage.Username;
 }
        public void TimeoutPromptsMessageSending_Data()
        {
            var bus = MockRepository.GenerateMock<IBus>();

            var sendOneEmailNow = new SendOneEmailNow();
            bus.Expect(b => b.Send(Arg<string>.Is.Anything, Arg<SendOneEmailNow>.Is.NotNull))
               .WhenCalled(i => sendOneEmailNow = (SendOneEmailNow)(i.Arguments[1]));

            var dataId = Guid.NewGuid();
            var originalMessage = new ScheduleEmailForSendingLater { EmailData = new EmailData
                {
                    BodyHtml = "html",
                    BodyText = "text",
                    FromAddress = "from",
                    FromDisplayName = "display",
                    ReplyToAddress = "replyto",
                    Subject = "subject",
                    ToAddress = "to"
                }};
            var data = new ScheduledEmailData { Id = dataId, OriginalMessageData = new OriginalEmailMessageData(originalMessage) };

            var scheduleEmail = new EmailScheduler { Bus = bus, Data = data };
            var timeoutMessage = new ScheduleEmailTimeout();
            scheduleEmail.Timeout(timeoutMessage);

            Assert.That(sendOneEmailNow.BodyHtml, Is.EqualTo(data.OriginalMessageData.BodyHtml));
            Assert.That(sendOneEmailNow.BodyText, Is.EqualTo(data.OriginalMessageData.BodyText));
            Assert.That(sendOneEmailNow.FromAddress, Is.EqualTo(data.OriginalMessageData.FromAddress));
            Assert.That(sendOneEmailNow.FromDisplayName, Is.EqualTo(data.OriginalMessageData.FromDisplayName));
            Assert.That(sendOneEmailNow.ReplyToAddress, Is.EqualTo(data.OriginalMessageData.ReplyToAddress));
            Assert.That(sendOneEmailNow.Subject, Is.EqualTo(data.OriginalMessageData.Subject));
            Assert.That(sendOneEmailNow.ToAddress, Is.EqualTo(data.OriginalMessageData.ToAddress));
            Assert.That(sendOneEmailNow.Username, Is.EqualTo(data.OriginalMessageData.Username));
            Assert.That(sendOneEmailNow.CorrelationId, Is.EqualTo(data.Id));

            bus.VerifyAllExpectations();
        }