Esempio n. 1
0
        public void RangeInvalid()
        {
            var v = new temp
            {
                RequiredString = "str",
                Range          = 1
            }
            .IsValid();
            var r = v.Model();

            Assert.IsFalse(v.IsValid);
            Assert.AreEqual(1, v.Errors.Count());
        }
Esempio n. 2
0
        public void RangeInvalid()
        {
            var v = new temp
            {
                RequiredString = "str",
                Range = 1
            }
            .IsValid();
            var r = v.Model();

            Assert.IsFalse(v.IsValid);
            Assert.AreEqual(1, v.Errors.Count());
        }
Esempio n. 3
0
        public void ExecuteRequiredStringValidator()
        {
            var v = new temp
            {
                RequiredString = null,
                Range          = 50
            }
            .IsValid();
            var r = v.Model();

            Assert.IsFalse(r);
            Assert.IsFalse(v.IsValid);
            Assert.AreEqual(1, v.Errors.Count());
        }
Esempio n. 4
0
        public void ExecuteRequiredStringValidatorIsValid()
        {
            var v = new temp
            {
                RequiredString = "string",
                Range          = 50
            }
            .IsValid();
            var r = v.Model();

            Assert.IsTrue(r);
            Assert.IsTrue(v.IsValid);
            Assert.AreEqual(0, v.Errors.Count());
        }
Esempio n. 5
0
        public void ExecuteRequiredStringValidator()
        {
            var v = new temp
            {
                RequiredString = null,
                Range = 50
            }
            .IsValid();
            var r = v.Model();

            Assert.IsFalse(r);
            Assert.IsFalse(v.IsValid);
            Assert.AreEqual(1, v.Errors.Count());
        }
Esempio n. 6
0
        public void ValidationMessagesSet()
        {
            var validatable = new temp
            {
                RequiredString = null,
                Range          = 0
            }
            .IsValid();

            var r = validatable.Model();

            Assert.IsFalse(r);

            Assert.AreEqual(2, validatable.Errors.Count());
        }
Esempio n. 7
0
        public void ExecuteRequiredStringValidatorIsValid()
        {

            var v = new temp
            {
                RequiredString = "string",
                Range = 50
            }
            .IsValid();
            var r = v.Model();

            Assert.IsTrue(r);
            Assert.IsTrue(v.IsValid);
            Assert.AreEqual(0, v.Errors.Count());
        }
Esempio n. 8
0
        public void ValidationMessagesSet()
        {
            var validatable = new temp
            {
                RequiredString = null,
                Range = 0
            }
            .IsValid();

            var r = validatable.Model();

            Assert.IsFalse(r);

            Assert.AreEqual(2, validatable.Errors.Count());
        }