Example #1
0
        public void RMinLengthAttributeDisplayValueCorrect()
        {
            var result = new RMinLengthAttribute(3).Validate(() => new { String = "ho" }, "String", "Last Name");

            Assert.IsNotNull(result);
            Assert.IsTrue(result.ErrorMessage.Contains("Last Name"));
        }
Example #2
0
        public void RMinLengthAttributeNegative()
        {
            var result = new RMinLengthAttribute(3).Validate(() => new { String = "ho" }, "String");

            Assert.IsNotNull(result);
        }
Example #3
0
        public void RMaxLengthAttributeCollectionNegative()
        {
            var result = new RMinLengthAttribute(5).Validate(() => new { Collection = new[] { 1, 2, 3 } }, "Collection");

            Assert.IsNotNull(result);
        }
Example #4
0
        public void RMaxLengthAttributeCollectionPositive()
        {
            var result = new RMinLengthAttribute(2).Validate(() => new { Collection = new[] { 1, 2 } }, "Collection");

            Assert.IsNull(result);
        }