Removed registration of old-style configuration in Netcore executable.
This commit is contained in:
@@ -7,7 +7,7 @@ namespace Umbraco.Tests.Common.Builders
|
||||
public class RequestHandlerSettingsBuilder : BuilderBase<RequestHandlerSettings>
|
||||
{
|
||||
private bool? _addTrailingSlash;
|
||||
private bool? _convertUrlsToAscii;
|
||||
private string _convertUrlsToAscii;
|
||||
private IEnumerable<IChar> _charCollection;
|
||||
|
||||
public RequestHandlerSettingsBuilder WithAddTrailingSlash(bool addTrailingSlash)
|
||||
@@ -16,7 +16,7 @@ namespace Umbraco.Tests.Common.Builders
|
||||
return this;
|
||||
}
|
||||
|
||||
public RequestHandlerSettingsBuilder WithConvertUrlsToAscii(bool convertUrlsToAscii)
|
||||
public RequestHandlerSettingsBuilder WithConvertUrlsToAscii(string convertUrlsToAscii)
|
||||
{
|
||||
_convertUrlsToAscii = convertUrlsToAscii;
|
||||
return this;
|
||||
@@ -26,13 +26,12 @@ namespace Umbraco.Tests.Common.Builders
|
||||
{
|
||||
_charCollection = charCollection;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public override RequestHandlerSettings Build()
|
||||
{
|
||||
var addTrailingSlash = _addTrailingSlash ?? false;
|
||||
var convertUrlsToAscii = _convertUrlsToAscii ?? false;
|
||||
var convertUrlsToAscii = _convertUrlsToAscii ?? "false";
|
||||
var charCollection = _charCollection ?? RequestHandlerSettings.DefaultCharCollection;
|
||||
|
||||
return new RequestHandlerSettings
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Umbraco.Tests.UnitTests.Umbraco.Tests.Common.Builders
|
||||
{
|
||||
// Arrange
|
||||
const bool addTrailingSlash = true;
|
||||
const bool convertUrlsToAscii = true;
|
||||
const string convertUrlsToAscii = "try";
|
||||
var charCollection = new List<IChar> { new CharItem { Char = "a", Replacement = "b" } };
|
||||
|
||||
var builder = new RequestHandlerSettingsBuilder();
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Umbraco.Tests.Configurations
|
||||
|
||||
var hostingEnvironment = new AspNetHostingEnvironment(mockHostingSettings.Object);
|
||||
|
||||
var globalSettings = new GlobalSettingsBuilder().WithUmbracoPath(path).Build();
|
||||
var globalSettings = new GlobalSettingsBuilder().WithPath(path).Build();
|
||||
|
||||
Assert.AreEqual(outcome, globalSettings.GetUmbracoMvcAreaNoCache(hostingEnvironment));
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace Umbraco.Tests.Strings
|
||||
public void U4_4056()
|
||||
{
|
||||
var requestHandlerSettings = new RequestHandlerSettingsBuilder()
|
||||
.WithConvertUrlsToAscii(false)
|
||||
.WithConvertUrlsToAscii("false")
|
||||
.WithCharCollection(Enumerable.Empty<IChar>())
|
||||
.Build();
|
||||
|
||||
@@ -123,7 +123,7 @@ namespace Umbraco.Tests.Strings
|
||||
public void U4_4056_TryAscii()
|
||||
{
|
||||
var requestHandlerSettings = new RequestHandlerSettingsBuilder()
|
||||
.WithConvertUrlsToAscii(false)
|
||||
.WithConvertUrlsToAscii("false")
|
||||
.WithCharCollection(Enumerable.Empty<IChar>())
|
||||
.Build();
|
||||
|
||||
@@ -411,7 +411,7 @@ namespace Umbraco.Tests.Strings
|
||||
var settings = _requestHandlerSettings;
|
||||
var contentMock = Mock.Get(settings);
|
||||
contentMock.Setup(x => x.CharCollection).Returns(Enumerable.Empty<IChar>());
|
||||
contentMock.Setup(x => x.ConvertUrlsToAscii).Returns(false);
|
||||
contentMock.Setup(x => x.ConvertUrlsToAscii).Returns("false");
|
||||
|
||||
var helper = new DefaultShortStringHelper(new DefaultShortStringHelperConfig().WithDefault(settings));
|
||||
|
||||
|
||||
@@ -127,11 +127,6 @@ namespace Umbraco.Extensions
|
||||
services.Configure<UserPasswordConfigurationSettings>(configuration.GetSection(Constants.Configuration.ConfigSecurityPrefix + "UserPassword"));
|
||||
services.Configure<WebRoutingSettings>(configuration.GetSection(Constants.Configuration.ConfigPrefix + "WebRouting"));
|
||||
|
||||
// TODO: remove this
|
||||
var configsFactory = new AspNetCoreConfigsFactory(configuration);
|
||||
var configs = configsFactory.Create();
|
||||
services.AddSingleton(configs);
|
||||
|
||||
return services;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user