Example #1
0
            public void ShouldThrowExceptionWhenSizeIsInvalid()
            {
                var richMenu = new RichMenu()
                {
                    Areas = new[]
                    {
                        new RichMenuArea()
                        {
                            Action = new MessageAction()
                            {
                                Label = "Foo", Text = "Bar"
                            },
                            Bounds = new RichMenuBounds(1, 2, 3, 4)
                        }
                    },
                    ChatBarText = "foobar",
                    Name        = "barfoo",
                    Size        = new RichMenuSize()
                };

                ExceptionAssert.Throws <InvalidOperationException>("The height is not set.", () =>
                {
                    richMenu.Validate();
                });
            }
Example #2
0
            public void ShouldThrowExceptionWhenAreasIsNull()
            {
                var richMenu = new RichMenu();

                ExceptionAssert.Throws <InvalidOperationException>("The areas cannot be null.", () =>
                {
                    richMenu.Validate();
                });
            }
Example #3
0
            public void ShouldThrowExceptionWhenChatBarTextIsNull()
            {
                var richMenu = new RichMenu()
                {
                    Areas = new RichMenuArea[1]
                };

                ExceptionAssert.Throws <InvalidOperationException>("The chat bar text cannot be null.", () =>
                {
                    richMenu.Validate();
                });
            }
Example #4
0
            public void ShouldThrowExceptionWhenNameIsNull()
            {
                var richMenu = new RichMenu()
                {
                    Areas       = new RichMenuArea[1],
                    ChatBarText = "foobar"
                };

                ExceptionAssert.Throws <InvalidOperationException>("The name cannot be null.", () =>
                {
                    richMenu.Validate();
                });
            }
Example #5
0
            public void ShouldThrowExceptionWhenAreasIsInvalid()
            {
                var richMenu = new RichMenu()
                {
                    Areas       = new[] { new RichMenuArea() },
                    ChatBarText = "foobar",
                    Name        = "barfoo",
                    Size        = new RichMenuSize()
                };

                ExceptionAssert.Throws <InvalidOperationException>("The action cannot be null.", () =>
                {
                    richMenu.Validate();
                });
            }
Example #6
0
            public void ShouldThrowExceptionWhenAreasHasNullValue()
            {
                var richMenu = new RichMenu()
                {
                    Areas       = new RichMenuArea[1],
                    ChatBarText = "foobar",
                    Name        = "barfoo",
                    Size        = new RichMenuSize()
                };

                ExceptionAssert.Throws <InvalidOperationException>("The rich menu area should not be null.", () =>
                {
                    richMenu.Validate();
                });
            }