Beispiel #1
0
            public void ShouldThrowExceptionWhenCancelActionIsNull()
            {
                ITemplate template = new ConfirmTemplate()
                {
                    Text     = "ConfirmText",
                    OkAction = new MessageAction()
                };

                ExceptionAssert.Throws <InvalidOperationException>("The cancel action cannot be null.", () =>
                {
                    template.Validate();
                });
            }
Beispiel #2
0
            public void ShouldThrowExceptionWhenOkActionIsInvalid()
            {
                ITemplate template = new ConfirmTemplate()
                {
                    Text     = "ConfirmText",
                    OkAction = new UriAction()
                    {
                        Label = "Foo"
                    },
                    CancelAction = new MessageAction()
                };

                ExceptionAssert.Throws <InvalidOperationException>("The url cannot be null.", () =>
                {
                    template.Validate();
                });
            }
Beispiel #3
0
            public void ShouldNotThrowExceptionWhenValid()
            {
                ITemplate template = new ConfirmTemplate()
                {
                    Text     = "ConfirmText",
                    OkAction = new MessageAction()
                    {
                        Label = "Foo", Text = "Bar"
                    },
                    CancelAction = new MessageAction()
                    {
                        Label = "Foo", Text = "Bar"
                    }
                };

                template.Validate();
            }