コード例 #1
0
            public void ShouldThrowExceptionWhenLabelIsNull()
            {
                IAction action = new DateTimePickerAction(DateTimePickerMode.Date);

                ExceptionAssert.Throws <InvalidOperationException>("The label cannot be null.", () =>
                {
                    action.Validate();
                });
            }
コード例 #2
0
            public void ShouldNotThrowExceptionWhenValid()
            {
                IAction action = new DateTimePickerAction(DateTimePickerMode.Date)
                {
                    Label = "Foo",
                    Data  = "Bar"
                };

                action.Validate();
            }
コード例 #3
0
            public void ShouldThrowExceptionWhenDataIsNull()
            {
                IAction action = new DateTimePickerAction(DateTimePickerMode.Date)
                {
                    Label = "PostbackLabel"
                };

                ExceptionAssert.Throws <InvalidOperationException>("The data cannot be null.", () =>
                {
                    action.Validate();
                });
            }