Exemplo n.º 1
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);
        }