Пример #1
0
        public void LengthTest()
        {
            IClassValidator validator = GetClassValidator(typeof(FooLength));

            FooLength f1 = new FooLength(1, "hola");
            validator.GetInvalidValues(f1).Should().Be.Empty();

            FooLength f2 = new FooLength(1, string.Empty);
            validator.GetInvalidValues(f2).Should().Not.Be.Empty();

            FooLength f3 = new FooLength(1, null);
            validator.GetInvalidValues(f3).Should().Not.Be.Empty();
        }
Пример #2
0
        public void LengthTest()
        {
            IClassValidator validator = GetClassValidator(typeof(FooLength));

            FooLength f1 = new FooLength(1, "hola");

            validator.GetInvalidValues(f1).Should().Be.Empty();

            FooLength f2 = new FooLength(1, string.Empty);

            validator.GetInvalidValues(f2).Should().Not.Be.Empty();

            FooLength f3 = new FooLength(1, null);

            validator.GetInvalidValues(f3).Should().Not.Be.Empty();
        }
        public void LengthTest()
        {
            FooLength f1 = new FooLength(1, "hola");
            IClassValidator validator = GetClassValidator(typeof(FooLength));

            InvalidValue[] res = validator.GetInvalidValues(f1);
            Assert.AreEqual(0, res.Length);

            FooLength f2 = new FooLength(1, string.Empty);

            InvalidValue[] res2 = validator.GetInvalidValues(f2);
            Assert.AreEqual(1, res2.Length);

            FooLength f3 = new FooLength(1, null);
            InvalidValue[] res3 = validator.GetInvalidValues(f3);
            Assert.AreEqual(1, res3.Length);
        }