v9: Throw error on duplicate routes (#11774)
* Add conflicting route service and check * Added testclass * Cleanup * Update src/Umbraco.Web.BackOffice/Services/ConflictingRouteService.cs Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com> * Implemented out variable Co-authored-by: Elitsa Marinovska <elm@umbraco.dk> Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
|
||||
namespace Umbraco.Cms.Tests.Integration.Testing
|
||||
{
|
||||
public class TestConflictingRouteService : IConflictingRouteService
|
||||
{
|
||||
public bool HasConflictingRoutes(out string controllername)
|
||||
{
|
||||
controllername = string.Empty;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -201,6 +201,9 @@ namespace Umbraco.Cms.Tests.Integration.Testing
|
||||
IWebHostEnvironment webHostEnvironment = TestHelper.GetWebHostEnvironment();
|
||||
services.AddRequiredNetCoreServices(TestHelper, webHostEnvironment);
|
||||
|
||||
// We register this service because we need it for IRuntimeState, if we don't this breaks 900 tests
|
||||
services.AddSingleton<IConflictingRouteService, TestConflictingRouteService>();
|
||||
|
||||
// Add it!
|
||||
Core.Hosting.IHostingEnvironment hostingEnvironment = TestHelper.GetHostingEnvironment();
|
||||
TypeLoader typeLoader = services.AddTypeLoader(
|
||||
|
||||
Reference in New Issue
Block a user