예제 #1
0
        public void AlertWithStatusWellDefinedIsValid()
        {
            var alert = new Alert();

            alert.Status = Status.Draft;

            var statusRequiredValidator = new StatusRequiredValidator(alert);

            Assert.True(statusRequiredValidator.IsValid);
        }
예제 #2
0
        public void AlertWithStatusWrongDefinedIsInvalid()
        {
            var alert = new Alert();

            alert.Status = (Status)123;

            var statusRequiredValidator = new StatusRequiredValidator(alert);

            Assert.False(statusRequiredValidator.IsValid);
            Assert.Equal(typeof(StatusRequiredError), statusRequiredValidator.Errors.ElementAt(0).GetType());
        }