/// <summary>
        /// Marks the message as rejected.
        /// </summary>
        /// <param name="providerStatus">The provider status.</param>
        /// <param name="rejectedDateTime">The rejected date time.</param>
        public void MarkMessageAsRejected(String providerStatus,
                                          DateTime rejectedDateTime)
        {
            this.CheckMessageCanBeSetToRejected();

            EmailMessageRejectedEvent messageRejectedEvent = new EmailMessageRejectedEvent(this.AggregateId, providerStatus, rejectedDateTime);

            this.ApplyAndAppend(messageRejectedEvent);
        }
        public void EmailMessageRejectedEvent_CanBeCreated_IsCreated()
        {
            EmailMessageRejectedEvent messageRejectedEvent =
                new EmailMessageRejectedEvent(TestData.MessageId, TestData.ProviderStatusDescription, TestData.RejectedDateTime);

            messageRejectedEvent.ShouldNotBeNull();
            messageRejectedEvent.AggregateId.ShouldBe(TestData.MessageId);
            messageRejectedEvent.EventId.ShouldNotBe(Guid.Empty);
            messageRejectedEvent.MessageId.ShouldBe(TestData.MessageId);
            messageRejectedEvent.ProviderStatus.ShouldBe(TestData.ProviderStatusDescription);
            messageRejectedEvent.RejectedDateTime.ShouldBe(TestData.RejectedDateTime);
        }
 /// <summary>
 /// Plays the event.
 /// </summary>
 /// <param name="domainEvent">The domain event.</param>
 private void PlayEvent(EmailMessageRejectedEvent domainEvent)
 {
     this.MessageStatus = MessageStatus.Rejected;
 }