/// <summary>
        /// Marks the message as undeliverable.
        /// </summary>
        /// <param name="providerStatus">The provider status.</param>
        /// <param name="failedDateTime">The failed date time.</param>
        public void MarkMessageAsUndeliverable(String providerStatus,
                                               DateTime failedDateTime)
        {
            this.CheckMessageCanBeSetToUndeliverable();

            SMSMessageUndeliveredEvent messageUndeliveredEvent = new SMSMessageUndeliveredEvent(this.AggregateId, providerStatus, failedDateTime);

            this.ApplyAndAppend(messageUndeliveredEvent);
        }
        public void SMSMessageUndeliveredEvent_CanBeCreated_IsCreated()
        {
            SMSMessageUndeliveredEvent messageUndeliveredEvent =
                new SMSMessageUndeliveredEvent(TestData.MessageId, TestData.ProviderStatusDescription, TestData.UndeliveredDateTime);

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