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