mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 03:25:23 +08:00
Fix Unit Tests
--HG-- branch : dev
This commit is contained in:
@@ -10,6 +10,7 @@ using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.ContentManagement.MetaData;
|
||||
using Orchard.ContentManagement.Records;
|
||||
using Orchard.Core.Common.Models;
|
||||
using Orchard.Core.Routable;
|
||||
using Orchard.Core.Routable.Handlers;
|
||||
using Orchard.Core.Routable.Models;
|
||||
using Orchard.Core.Routable.Services;
|
||||
@@ -35,6 +36,7 @@ namespace Orchard.Core.Tests.Common.Services {
|
||||
builder.RegisterType<ThingHandler>().As<IContentHandler>();
|
||||
builder.RegisterType<StuffHandler>().As<IContentHandler>();
|
||||
builder.RegisterType<RoutableService>().As<IRoutableService>();
|
||||
builder.RegisterType<RoutablePathConstraint>().As<IRoutablePathConstraint>();
|
||||
|
||||
builder.RegisterType<DefaultContentQuery>().As<IContentQuery>();
|
||||
builder.RegisterInstance(new UrlHelper(new RequestContext(new StubHttpContext("~/"), new RouteData()))).As<UrlHelper>();
|
||||
|
@@ -12,7 +12,10 @@ namespace Orchard.Core.Routable.Handlers {
|
||||
_routablePathConstraint = routablePathConstraint;
|
||||
Filters.Add(StorageFilter.For(repository));
|
||||
|
||||
OnPublished<IsRoutable>((context, routable) => _routablePathConstraint.AddPath(routable.Path));
|
||||
OnPublished<IsRoutable>((context, routable) => {
|
||||
if (!string.IsNullOrEmpty(routable.Path))
|
||||
_routablePathConstraint.AddPath(routable.Path);
|
||||
});
|
||||
}
|
||||
}
|
||||
public class IsRoutableHandler : ContentHandlerBase {
|
||||
|
Reference in New Issue
Block a user