public void AlertWithScopeRestrictedAndRestrictionIsValid()
        {
            var alert = new Alert();
            alert.Scope = Scope.Restricted;
            alert.Restriction = "Draft";

            var restrictionValidator = new RestrictionValidator(alert);
            Assert.True(restrictionValidator.IsValid);
        }
        public void AlertWithScopeDifferentFromRestrictedAndRestrictionNullIsValid()
        {
            var alert = new Alert();
            alert.Scope = Scope.Public;
            alert.Restriction = null;

            var restrictionValidator = new RestrictionValidator(alert);
            Assert.True(restrictionValidator.IsValid);
        }
Esempio n. 3
0
        public void AlertWithScopeDifferentFromRestrictedAndRestrictionNullIsValid()
        {
            var alert = new Alert();

            alert.Scope       = Scope.Public;
            alert.Restriction = null;

            var restrictionValidator = new RestrictionValidator(alert);

            Assert.True(restrictionValidator.IsValid);
        }
Esempio n. 4
0
        public void AlertWithScopeRestrictedAndRestrictionIsValid()
        {
            var alert = new Alert();

            alert.Scope       = Scope.Restricted;
            alert.Restriction = "Draft";

            var restrictionValidator = new RestrictionValidator(alert);

            Assert.True(restrictionValidator.IsValid);
        }
        public void AlertWithScopeRestrictedAndRestrictionNullIsInvalid()
        {
            var alert = new Alert();
            alert.Scope = Scope.Restricted;
            alert.Restriction = null;

            var restrictionValidator = new RestrictionValidator(alert);
            Assert.False(restrictionValidator.IsValid);

            var restrictionErrors = from error in restrictionValidator.Errors
                                    where error.GetType() == typeof(RestrictionError)
                                    select error;
            Assert.NotEmpty(restrictionErrors);
        }
Esempio n. 6
0
        public void AlertWithScopeDifferentFromRestrictedAndRestrictionIsInvalid()
        {
            var alert = new Alert();

            alert.Scope       = Scope.Public;
            alert.Restriction = "Draft";

            var restrictionValidator = new RestrictionValidator(alert);

            Assert.False(restrictionValidator.IsValid);

            var restrictionErrors = from error in restrictionValidator.Errors
                                    where error.GetType() == typeof(RestrictionError)
                                    select error;

            Assert.NotEmpty(restrictionErrors);
        }