diff --git a/src/Umbraco.Tests/PropertyEditors/MultiValuePropertyEditorTests.cs b/src/Umbraco.Tests/PropertyEditors/MultiValuePropertyEditorTests.cs index 42b9d174df..0ba844ca6b 100644 --- a/src/Umbraco.Tests/PropertyEditors/MultiValuePropertyEditorTests.cs +++ b/src/Umbraco.Tests/PropertyEditors/MultiValuePropertyEditorTests.cs @@ -1,10 +1,21 @@ using System; using System.Collections.Generic; +using System.ComponentModel; +using System.Globalization; +using System.Linq; using Moq; using NUnit.Framework; +using Umbraco.Core; +using Umbraco.Core.Logging; using Umbraco.Core.Models; +using Umbraco.Core.Persistence; +using Umbraco.Core.Persistence.SqlSyntax; +using Umbraco.Core.Persistence.UnitOfWork; +using Umbraco.Core.Profiling; using Umbraco.Core.PropertyEditors; +using Umbraco.Core.Publishing; using Umbraco.Core.Services; +using Umbraco.Core.Strings; using Umbraco.Web.PropertyEditors; namespace Umbraco.Tests.PropertyEditors @@ -88,6 +99,22 @@ namespace Umbraco.Tests.PropertyEditors [Test] public void DropDownPreValueEditor_Format_Data_For_Editor() { + // editor wants ApplicationContext.Current.Services.TextService + // (that should be fixed with proper injection) + var logger = Mock.Of(); + var textService = new Mock(); + textService.Setup(x => x.Localize(It.IsAny(), It.IsAny(), It.IsAny>())).Returns("blah"); + var appContext = new ApplicationContext( + new DatabaseContext(Mock.Of(), logger, new SqlSyntaxProviders(Enumerable.Empty())), + new ServiceContext( + localizedTextService: textService.Object + ), + Mock.Of(), + new ProfilingLogger(logger, Mock.Of())) + { + IsReady = true + }; + ApplicationContext.Current = appContext; var defaultVals = new Dictionary(); var persisted = new PreValueCollection(new Dictionary diff --git a/src/Umbraco.Web/PropertyEditors/ValueListPreValueEditor.cs b/src/Umbraco.Web/PropertyEditors/ValueListPreValueEditor.cs index 41c45efb98..2c6357de3d 100644 --- a/src/Umbraco.Web/PropertyEditors/ValueListPreValueEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ValueListPreValueEditor.cs @@ -46,7 +46,7 @@ namespace Umbraco.Web.PropertyEditors //It's also important to note that by default the dropdown angular controller is expecting the // config options to come in with a property called 'items' Key = "items", - Name = ApplicationContext.Current.Services.TextService.Localize("editdatatype/addPrevalue"), + Name = ApplicationContext.Current.Services.TextService.Localize("editdatatype/addPrevalue"), // todo: inject View = "multivalues" } };