Centralizes logic to validate complex editors, starts transitioning to new JSON error messages for complex editors, starts adding tests

This commit is contained in:
Shannon
2020-06-15 23:05:32 +10:00
parent ba43a43483
commit 32e3ebb6fb
27 changed files with 659 additions and 193 deletions

View File

@@ -442,7 +442,10 @@ namespace Umbraco.Tests.Models
[Test]
public void ContentPublishValuesWithMixedPropertyTypeVariations()
{
var propertyValidationService = new PropertyValidationService(Current.Factory.GetInstance<PropertyEditorCollection>(), Current.Factory.GetInstance<ServiceContext>().DataTypeService);
var propertyValidationService = new PropertyValidationService(
Current.Factory.GetInstance<PropertyEditorCollection>(),
Current.Factory.GetInstance<ServiceContext>().DataTypeService,
Current.Factory.GetInstance<ServiceContext>().TextService);
const string langFr = "fr-FR";
// content type varies by Culture
@@ -574,7 +577,10 @@ namespace Umbraco.Tests.Models
prop.SetValue("a");
Assert.AreEqual("a", prop.GetValue());
Assert.IsNull(prop.GetValue(published: true));
var propertyValidationService = new PropertyValidationService(Current.Factory.GetInstance<PropertyEditorCollection>(), Current.Factory.GetInstance<ServiceContext>().DataTypeService);
var propertyValidationService = new PropertyValidationService(
Current.Factory.GetInstance<PropertyEditorCollection>(),
Current.Factory.GetInstance<ServiceContext>().DataTypeService,
Current.Factory.GetInstance<ServiceContext>().TextService);
Assert.IsTrue(propertyValidationService.IsPropertyValid(prop));