コード例 #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());
        }