Exemple #1
0
            public void ShouldAddSingleItem()
            {
                // Arrange
                var objectToAdd = new PersonValidator();

                // Act
                var collection = new FluentValidatorCollection <Person> {
                    objectToAdd
                };

                // Assert
                collection.ShouldContain(objectToAdd);
            }
Exemple #2
0
            public void ShouldAddRangeOfItems()
            {
                // Arrange
                IEnumerable <AbstractValidator <Person> > validators = new List <AbstractValidator <Person> >
                {
                    new PersonValidator()
                };

                var collection = new FluentValidatorCollection <Person>();

                // Act
                collection.AddRange(validators);

                // Assert
                foreach (AbstractValidator <Person> item in validators)
                {
                    collection.ShouldContain(item);
                }
            }