Braintree.Tests.ValidationErrorsTest.DeepCount_WithNestedErrors C# (CSharp) Метод

DeepCount_WithNestedErrors() приватный Метод

private DeepCount_WithNestedErrors ( ) : void
Результат void
        public void DeepCount_WithNestedErrors()
        {
            ValidationErrors addressErrors = new ValidationErrors();
            addressErrors.AddError("country_name", new ValidationError("country_name", "1", "invalid country"));
            addressErrors.AddError("another_field", new ValidationError("another_field", "2", "another message"));

            ValidationErrors errors = new ValidationErrors();
            errors.AddError("some_field", new ValidationError("some_field", "3", "some message"));
            errors.AddErrors("address", addressErrors);

            Assert.AreEqual(3, errors.DeepCount);
            Assert.AreEqual(1, errors.Count);

            Assert.AreEqual(2, errors.ForObject("address").DeepCount);
            Assert.AreEqual(2, errors.ForObject("address").Count);
        }