public void ShouldThrowExceptionWhenCalledWithMoreThanFiveMessages()
 {
     ExceptionAssert.Throws <InvalidOperationException>("The maximum number of messages is 5.", () =>
     {
         ISendMessageExtensions.ValidateAndConvert(new ISendMessage[6]);
     });
 }
 public void ShouldThrowExceptionWhenMessageIsInvalid()
 {
     ExceptionAssert.Throws <InvalidOperationException>("The text cannot be null.", () =>
     {
         ISendMessageExtensions.ValidateAndConvert(new ISendMessage[1] {
             new TextMessage()
         });
     });
 }
 public void ShouldThrowExceptionWhenMessageTypeIsInvalid()
 {
     ExceptionAssert.Throws <NotSupportedException>("Invalid message type.", () =>
     {
         ISendMessageExtensions.ValidateAndConvert(new ISendMessage[1] {
             new InvalidMessage()
         });
     });
 }
 public void ShouldThrowExceptionWhenArrarHasNullValue()
 {
     ExceptionAssert.Throws <InvalidOperationException>("The message should not be null.", () =>
     {
         ISendMessageExtensions.ValidateAndConvert(new ISendMessage[1] {
             null
         });
     });
 }