public void WhenTemplateUriIsNotEmpty_ThenValidateTemplateUriIsNotEmptySucceeds() { var templateValidator = new TemplateValidator(this.settings.Name, new UnfoldVsTemplateCommand.UnfoldVsTemplateSettings { TemplateUri = "foo", OwnerElement = this.product }, validationContext, this.settings.Store); templateValidator.ValidateTemplateUriIsNotEmpty(); Assert.True(validationContext.CurrentViolations.Count == 0); }
public void ThenValidateTemplateUriIsNotEmptyFails() { var templateValidator = new TemplateValidator(this.settings.Name, new UnfoldVsTemplateCommand.UnfoldVsTemplateSettings { TemplateUri = string.Empty, OwnerElement = this.product, SettingsElement = (IAutomationSettingsSchema)this.settings.Extends, }, validationContext, this.settings.Store); templateValidator.ValidateTemplateUriIsNotEmpty(); Assert.True(validationContext.CurrentViolations.Count == 1); Assert.True(validationContext.ValidationSubjects.IndexOf(this.settings) == 0); }