public void ShouldThrowExceptionWhenCancelActionIsNull() { ITemplate template = new ConfirmTemplate() { Text = "ConfirmText", OkAction = new MessageAction() }; ExceptionAssert.Throws <InvalidOperationException>("The cancel action cannot be null.", () => { template.Validate(); }); }
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(); }); }
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(); }