Exemple #1
0
        public void Should_DocumentCategoryValidator_Name_IsNameUnique()
        {
            var documents = new List <DocumentCategory>();

            documents.Add(documentCategory);
            validator = new DocumentCategoryValidator(documents);

            results = validator.Validate(documentCategory);
            Assert.IsFalse(results.IsValid);

            results = validator.Validate(new DocumentCategory()
            {
                Id = 999, Name = "TEST"
            });
            Assert.IsTrue(results.IsValid);
        }
Exemple #2
0
        public void Should_DocumentCategoryValidator_Name_NotEmpty()
        {
            results = validator.Validate(documentCategory);
            Assert.IsTrue(results.IsValid);

            documentCategory.Name = "";
            results = validator.Validate(documentCategory);
            Assert.IsFalse(results.IsValid);
        }