コード例 #1
0
        public void ShouldValidateLargeArrays()
        {
            const int length = 1000000;
            var objectToValidate = new InnerObject[length];
            for (int i = 0; i < length; i++)
            {
                objectToValidate[i]=new InnerObject();
            }
            var validator = new ObjectValidator();

            var result = validator.Validate(new[] { objectToValidate }, null).ToArray();
            Assert.IsTrue(result.Any());
            Assert.AreEqual(length, result.Length);
        }
コード例 #2
0
        public void ShouldValidateLargeArrays()
        {
            const int length           = 1000000;
            var       objectToValidate = new InnerObject[length];

            for (int i = 0; i < length; i++)
            {
                objectToValidate[i] = new InnerObject();
            }
            var validator = new ObjectValidator();

            var result = validator.Validate(new[] { objectToValidate }, null).ToArray();

            Assert.IsTrue(result.Any());
            Assert.AreEqual(length, result.Length);
        }