public void TestCollection() { IList persons = new ArrayList(); persons.Add(new TestObject("Damjan Tomic", 24)); persons.Add(new TestObject("Goran Milosavljevic", 24)); persons.Add(new TestObject("Ivan Cikic", 28)); RequiredValidator req = new RequiredValidator("Name", "true"); RegularExpressionValidator reg = new RegularExpressionValidator("Name", "true", @"[a-z]*\s[a-z]*"); reg.Options = RegexOptions.IgnoreCase; CollectionValidator validator = new CollectionValidator(); validator.Validators.Add(req); validator.Validators.Add(reg); Assert.IsTrue(validator.Validate(persons, new ValidationErrors())); }