public void When_an_element_is_deleted_Then_its_package_should_be_validated()
        {
            Element element = bLibrary.AddClass("An element");

            validatingCCRepository.LoadElementByID(element.ElementID);
            validatingCCRepository.ItemDeleted(ItemId.ForElement(element.ElementID));
            issueHandler.AssertReceivedIssuesTotal(0);
        }
Пример #2
0
        public void Context()
        {
            validationService = new ValidationService();
            ItemId itemId = ItemId.ForElement(1);

            itemConstraintViolations = new[] { new ConstraintViolation(itemId, itemId, "A constraint has been violated.") };
            item          = new RepositoryItemBuilder().WithId(itemId).Build();
            validatorMock = new Mock <IValidator>();
            validatorMock.Setup(c => c.Matches(It.IsAny <RepositoryItem>())).Returns(true);
            validatorMock.Setup(c => c.Validate(It.IsAny <RepositoryItem>())).Returns(itemConstraintViolations);
            validationService.AddValidator(validatorMock.Object);
        }