Ejemplo n.º 1
0
        public void Should_have_validation_error_when_site_id_is_empty()
        {
            var command = new BaseSiteCommand
            {
                SiteId = Guid.Empty
            };

            var siteRulesMock = new Mock <ISiteRules>();
            var validator     = new BaseSiteValidator <BaseSiteCommand>(siteRulesMock.Object);

            validator.ShouldHaveValidationErrorFor(x => x.SiteId, command);
        }
Ejemplo n.º 2
0
        public void Should_have_validation_error_when_site_does_not_exist()
        {
            var command = new BaseSiteCommand
            {
                SiteId = Guid.NewGuid()
            };

            var siteRulesMock = new Mock <ISiteRules>();

            siteRulesMock.Setup(x => x.DoesSiteExist(command.SiteId)).Returns(false);

            var validator = new BaseSiteValidator <BaseSiteCommand>(siteRulesMock.Object);

            validator.ShouldHaveValidationErrorFor(x => x.SiteId, command);
        }