Ejemplo n.º 1
0
        public void ValidateItem_ITemWithNoCategory_ReturnsProperErrorMessage()
        {
            var testItem = new ContentsLimit.Business.Models.ContentItem()
            {
                CategoryId = 0
            };

            var validationResult = new ContentsLimit.Business.ItemValidator().CreateItemIsValid(testItem);

            Assert.AreEqual(LibBus.ERROR_CATEGORY_NOT_SET, "Choose a category.", "Validation of item category id == 0 did not return correct error message.");
        }
Ejemplo n.º 2
0
        public void ValidateItem_ItemWithNoCategory_FailsValidation()
        {
            // Arrange - the current validation only looks for CategoryId mapping to a enum value inside Business.Models.Category.CategoryTypes
            var testItem = new ContentsLimit.Business.Models.ContentItem()
            {
                CategoryId = 0
            };

            // Act
            var validationResult = new ContentsLimit.Business.ItemValidator().CreateItemIsValid(testItem);

            // Assert.
            Assert.IsFalse(validationResult.IsValid, "Validation of item category id == 0 failed.");
        }