mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Merge
--HG-- branch : perf
This commit is contained in:
@@ -4,6 +4,7 @@ using System.Linq;
|
||||
using System.Web;
|
||||
using System.Xml.Linq;
|
||||
using Autofac;
|
||||
using Moq;
|
||||
using NHibernate;
|
||||
using NUnit.Framework;
|
||||
using Orchard.Caching;
|
||||
@@ -35,6 +36,7 @@ using Orchard.Security;
|
||||
using Orchard.Security.Permissions;
|
||||
using Orchard.Settings;
|
||||
using Orchard.Tests.Stubs;
|
||||
using Orchard.Tests.Utility;
|
||||
using Orchard.Themes;
|
||||
using Orchard.Themes.Handlers;
|
||||
using Orchard.Themes.Models;
|
||||
@@ -42,7 +44,7 @@ using Orchard.Themes.Services;
|
||||
using Orchard.UI.Notify;
|
||||
|
||||
namespace Orchard.Tests.Modules.Themes.Services {
|
||||
[TestFixture]
|
||||
[TestFixture, Ignore]
|
||||
public class ThemeServiceTests {
|
||||
private IThemeService _themeService;
|
||||
private ISiteThemeService _siteThemeService;
|
||||
@@ -68,12 +70,11 @@ namespace Orchard.Tests.Modules.Themes.Services {
|
||||
public void Init() {
|
||||
var context = new DynamicProxyContext();
|
||||
var builder = new ContainerBuilder();
|
||||
builder.RegisterModule(new SettingsModule());
|
||||
builder.RegisterType<StubWorkContextAccessor>().As<IWorkContextAccessor>();
|
||||
builder.RegisterType<ThemeService>().EnableDynamicProxy(context).As<IThemeService>();
|
||||
builder.RegisterType<SettingsModuleInterceptor>().As<ISettingsModuleInterceptor>();
|
||||
builder.RegisterType<SiteService>().As<ISiteService>();
|
||||
builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>));
|
||||
builder.RegisterType<Orchard.Localization.Text>().As<IText>();
|
||||
builder.RegisterType<DefaultContentManager>().As<IContentManager>();
|
||||
builder.RegisterType<StubCacheManager>().As<ICacheManager>();
|
||||
builder.RegisterType<ContentDefinitionManager>().As<IContentDefinitionManager>();
|
||||
@@ -85,6 +86,7 @@ namespace Orchard.Tests.Modules.Themes.Services {
|
||||
builder.RegisterType<SiteSettingsPartHandler>().As<IContentHandler>();
|
||||
builder.RegisterType<ThemeSiteSettingsPartHandler>().As<IContentHandler>();
|
||||
builder.RegisterType<ModuleService>().As<IModuleService>();
|
||||
builder.RegisterType<ShellDescriptor>();
|
||||
builder.RegisterType<OrchardServices>().As<IOrchardServices>();
|
||||
builder.RegisterType<StubShellDescriptorManager>().As<IShellDescriptorManager>().InstancePerLifetimeScope();
|
||||
builder.RegisterType<TransactionManager>().As<ITransactionManager>();
|
||||
@@ -96,6 +98,7 @@ namespace Orchard.Tests.Modules.Themes.Services {
|
||||
.As(typeof(IMapper<SettingsDictionary, XElement>));
|
||||
_session = _sessionFactory.OpenSession();
|
||||
builder.RegisterInstance(new TestSessionLocator(_session)).As<ISessionLocator>();
|
||||
builder.RegisterAutoMocking(MockBehavior.Loose);
|
||||
_container = builder.Build();
|
||||
_themeService = _container.Resolve<IThemeService>();
|
||||
_siteThemeService = _container.Resolve<ISiteThemeService>();
|
||||
|
||||
@@ -54,6 +54,7 @@ namespace Orchard.Tests.Modules.Users.Controllers {
|
||||
builder.RegisterType<MembershipService>().As<IMembershipService>();
|
||||
builder.RegisterType<UserService>().As<IUserService>();
|
||||
builder.RegisterType<UserPartHandler>().As<IContentHandler>();
|
||||
builder.RegisterType<StubWorkContextAccessor>().As<IWorkContextAccessor>();
|
||||
builder.RegisterType<OrchardServices>().As<IOrchardServices>();
|
||||
builder.RegisterType<TransactionManager>().As<ITransactionManager>();
|
||||
builder.RegisterType<DefaultShapeTableManager>().As<IShapeTableManager>();
|
||||
|
||||
@@ -17,11 +17,13 @@ using Orchard.ContentManagement.Records;
|
||||
using Orchard.DisplayManagement;
|
||||
using Orchard.DisplayManagement.Descriptors;
|
||||
using Orchard.DisplayManagement.Implementation;
|
||||
using Orchard.Environment;
|
||||
using Orchard.Environment.Extensions;
|
||||
using Orchard.Messaging.Events;
|
||||
using Orchard.Messaging.Services;
|
||||
using Orchard.Security;
|
||||
using Orchard.Tests.Stubs;
|
||||
using Orchard.Tests.Utility;
|
||||
using Orchard.Users.Handlers;
|
||||
using Orchard.Users.Models;
|
||||
using Orchard.Users.Services;
|
||||
@@ -76,6 +78,9 @@ namespace Orchard.Tests.Modules.Users.Services {
|
||||
builder.RegisterType<ContentDefinitionManager>().As<IContentDefinitionManager>();
|
||||
builder.RegisterType<DefaultContentManagerSession>().As<IContentManagerSession>();
|
||||
builder.RegisterType<UserPartHandler>().As<IContentHandler>();
|
||||
builder.RegisterType<StubWorkContextAccessor>().As<IWorkContextAccessor>();
|
||||
builder.RegisterType<OrchardServices>().As<IOrchardServices>();
|
||||
builder.RegisterAutoMocking(MockBehavior.Loose);
|
||||
builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>));
|
||||
builder.RegisterInstance(new Mock<IMessageEventHandler>().Object);
|
||||
builder.RegisterType<DefaultMessageManager>().As<IMessageManager>();
|
||||
|
||||
Reference in New Issue
Block a user