Example #1
0
        public void Validate_WhenAllPredicatesAreNotOk_ErrorListContainsAllErrors()
        {
            const string dogsName  = "";
            const string dogsBreed = "";

            var validator = new DogValidator(dogsName, dogsBreed);

            validator.Validate().ShouldBe(new [] { "dogs name cannot be null not empty", "dogs breed cannot be null not empty" });
        }
Example #2
0
        public void Validate_WhenOnlyOnePredicateIsNotOk_ErrorListContainsASingleErrorRelatedToThesePredicate()
        {
            const string dogsName  = "";
            const string dogsBreed = "husky";

            var validator = new DogValidator(dogsName, dogsBreed);

            validator.Validate().ShouldBe(new[] { "dogs name cannot be null not empty" });
        }
Example #3
0
        public void Validate_WhenAllPredicatesAreOk_ErrorListIsEmpty()
        {
            const string dogsName  = "bob";
            const string dogsBreed = "random";

            var validator = new DogValidator(dogsName, dogsBreed);

            validator.Validate().ShouldBeEmpty();
        }