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

                ISendMessageExtensions.Validate(new ISendMessage[1] {
                    message
                });
            }
            public void ShouldNotThrowExceptionWhenMessageIsVideoMessage()
            {
                var message = new VideoMessage()
                {
                    Url        = new Uri("https://foo.bar"),
                    PreviewUrl = new Uri("https://bar.foo")
                };

                ISendMessageExtensions.Validate(new ISendMessage[1] {
                    message
                });
            }
            public void ShouldNotThrowExceptionWhenMessageIsStickerMessage()
            {
                var message = new StickerMessage()
                {
                    PackageId = "1",
                    StickerId = "2"
                };

                ISendMessageExtensions.Validate(new ISendMessage[1] {
                    message
                });
            }
            public void ShouldNotThrowExceptionWhenMessageIsLocationMessage()
            {
                var message = new LocationMessage()
                {
                    Title   = "Foo",
                    Address = "Bar"
                };

                ISendMessageExtensions.Validate(new ISendMessage[1] {
                    message
                });
            }
            public void ShouldNotThrowExceptionWhenMessageIsAudioMessage()
            {
                var message = new AudioMessage()
                {
                    Url      = new Uri("https://foo.bar"),
                    Duration = 1
                };

                ISendMessageExtensions.Validate(new ISendMessage[1] {
                    message
                });
            }
            public void ShouldNotThrowExceptionWhenMessageIsImagemapMessage()
            {
                var message = new ImagemapMessage()
                {
                    BaseUrl         = new Uri("https://foo.bar"),
                    AlternativeText = "Foo",
                    BaseSize        = new ImagemapSize(10, 10),
                    Actions         = new[] { new ImagemapUriAction("https://foo.bar", new ImagemapArea(1, 2, 3, 4)) }
                };

                ISendMessageExtensions.Validate(new ISendMessage[1] {
                    message
                });
            }
            public void ShouldNotThrowExceptionWhenMessageIsTemplateMessage()
            {
                var message = new TemplateMessage()
                {
                    AlternativeText = "Foo",
                    Template        = new ButtonsTemplate()
                    {
                        Text    = "Foo",
                        Actions = new[] { new MessageAction()
                                          {
                                              Label = "Foo", Text = "Bar"
                                          } }
                    }
                };

                ISendMessageExtensions.Validate(new ISendMessage[1] {
                    message
                });
            }