public void Should_have_validation_error_when_site_id_is_empty() { var command = new RemovePageModule { SiteId = Guid.Empty }; var siteRulesMock = new Mock <ISiteRules>(); var validator = new RemovePageModuleValidator(siteRulesMock.Object); validator.ShouldHaveValidationErrorFor(x => x.SiteId, command); }
public void Should_have_validation_error_when_site_does_not_exist() { var command = new RemovePageModule { SiteId = Guid.NewGuid() }; var siteRulesMock = new Mock <ISiteRules>(); siteRulesMock.Setup(x => x.DoesSiteExist(command.SiteId)).Returns(false); var validator = new RemovePageModuleValidator(siteRulesMock.Object); validator.ShouldHaveValidationErrorFor(x => x.SiteId, command); }