mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 03:25:23 +08:00
Merge perf => dev
--HG-- branch : dev
This commit is contained in:
@@ -3,6 +3,7 @@ using System.IO;
|
||||
using Autofac;
|
||||
using Autofac.Features.Metadata;
|
||||
using NUnit.Framework;
|
||||
using Orchard.Caching;
|
||||
using Orchard.CodeGeneration.Commands;
|
||||
using Orchard.Commands;
|
||||
using Orchard.Data;
|
||||
@@ -15,6 +16,7 @@ using Orchard.Environment.ShellBuilders.Models;
|
||||
using Orchard.FileSystems.AppData;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Tests.FileSystems.AppData;
|
||||
using Orchard.Tests.Stubs;
|
||||
|
||||
namespace Orchard.Tests.Modules.CodeGeneration.Commands {
|
||||
[TestFixture]
|
||||
@@ -46,6 +48,7 @@ namespace Orchard.Tests.Modules.CodeGeneration.Commands {
|
||||
builder.RegisterType<CompositionStrategy>().As<ICompositionStrategy>();
|
||||
builder.RegisterType<ExtensionManager>().As<IExtensionManager>();
|
||||
builder.RegisterType<SchemaCommandGenerator>().As<ISchemaCommandGenerator>();
|
||||
builder.RegisterType<StubCacheManager>().As<ICacheManager>();
|
||||
|
||||
_container = builder.Build();
|
||||
_extensionManager = _container.Resolve<IExtensionManager>();
|
||||
@@ -54,7 +57,7 @@ namespace Orchard.Tests.Modules.CodeGeneration.Commands {
|
||||
|
||||
[Test]
|
||||
public void CreateDataMigrationTestNonExistentFeature() {
|
||||
CodeGenerationCommands codeGenerationCommands = new CodeGenerationCommands(_extensionManager,
|
||||
CodeGenerationCommands codeGenerationCommands = new CodeGenerationCommands(_extensionManager,
|
||||
_schemaCommandGenerator);
|
||||
|
||||
TextWriter textWriterOutput = new StringWriter();
|
||||
|
@@ -31,6 +31,7 @@ using Orchard.Data.Providers;
|
||||
using Orchard.Tests.FileSystems.AppData;
|
||||
using Orchard.Tests.Modules.Migrations.Orchard.Tests.DataMigration.Records;
|
||||
using Path = Bleroy.FluentPath.Path;
|
||||
using Orchard.Tests.Stubs;
|
||||
|
||||
namespace Orchard.Tests.Modules.Migrations {
|
||||
[TestFixture]
|
||||
@@ -83,6 +84,8 @@ namespace Orchard.Tests.Modules.Migrations {
|
||||
builder.RegisterType<ExtensionManager>().As<IExtensionManager>();
|
||||
builder.RegisterType<SchemaCommandGenerator>().As<ISchemaCommandGenerator>();
|
||||
builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>));
|
||||
builder.RegisterType<StubCacheManager>().As<ICacheManager>();
|
||||
|
||||
_session = _sessionFactory.OpenSession();
|
||||
builder.RegisterInstance(new DefaultContentManagerTests.TestSessionLocator(_session)).As<ISessionLocator>();
|
||||
|
||||
@@ -96,8 +99,8 @@ Name: Module1
|
||||
Version: 0.1
|
||||
OrchardVersion: 1
|
||||
Features:
|
||||
Feature1:
|
||||
Description: Feature
|
||||
Feature1:
|
||||
Description: Feature
|
||||
");
|
||||
}
|
||||
|
||||
@@ -115,16 +118,15 @@ Features:
|
||||
public IDictionary<string, string> Manifests { get; set; }
|
||||
|
||||
public IEnumerable<ExtensionDescriptor> AvailableExtensions() {
|
||||
foreach ( var e in Manifests ) {
|
||||
foreach (var e in Manifests) {
|
||||
string name = e.Key;
|
||||
var parseResult = ExtensionFolders.ParseManifest(Manifests[name]);
|
||||
yield return ExtensionFolders.GetDescriptorForExtension("~/", name, "Module", parseResult);
|
||||
yield return ExtensionFolders.GetDescriptorForExtension("~/", name, "Module", Manifests[name]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class StubLoaders : IExtensionLoader {
|
||||
#region Implementation of IExtensionLoader
|
||||
#region Implementation of IExtensionLoader
|
||||
|
||||
public int Order {
|
||||
get { return 1; }
|
||||
|
@@ -7,6 +7,7 @@ using System.Xml.Linq;
|
||||
using Autofac;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using Orchard.Caching;
|
||||
using Orchard.ContentManagement.MetaData;
|
||||
using Orchard.ContentManagement.MetaData.Models;
|
||||
using Orchard.ContentManagement.MetaData.Services;
|
||||
@@ -34,7 +35,6 @@ using Orchard.Users.Services;
|
||||
using Orchard.Users.ViewModels;
|
||||
using Orchard.Settings;
|
||||
using Orchard.Core.Settings.Services;
|
||||
using Orchard.Caching;
|
||||
|
||||
namespace Orchard.Tests.Modules.Users.Controllers {
|
||||
[TestFixture]
|
||||
@@ -66,6 +66,9 @@ namespace Orchard.Tests.Modules.Users.Controllers {
|
||||
builder.RegisterType<StubExtensionManager>().As<IExtensionManager>();
|
||||
builder.RegisterInstance(new Mock<INotifier>().Object);
|
||||
builder.RegisterInstance(new Mock<IContentDisplay>().Object);
|
||||
builder.RegisterType<StubCacheManager>().As<ICacheManager>();
|
||||
builder.RegisterType<Signals>().As<ISignals>();
|
||||
|
||||
_authorizer = new Mock<IAuthorizer>();
|
||||
builder.RegisterInstance(_authorizer.Object);
|
||||
}
|
||||
|
@@ -2,6 +2,8 @@
|
||||
using Autofac;
|
||||
using NUnit.Framework;
|
||||
using Orchard.Scripting.Services;
|
||||
using Orchard.Caching;
|
||||
using Orchard.Tests.Stubs;
|
||||
using Orchard.Widgets.RuleEngine;
|
||||
using Orchard.Widgets.Services;
|
||||
|
||||
@@ -18,6 +20,8 @@ namespace Orchard.Tests.Modules.Widgets {
|
||||
builder.RegisterType<ScriptingManager>().As<IScriptingManager>();
|
||||
builder.RegisterType<AlwaysTrueRuleProvider>().As<IRuleProvider>();
|
||||
builder.RegisterType<RuleManager>().As<IRuleManager>();
|
||||
builder.RegisterType<StubCacheManager>().As<ICacheManager>();
|
||||
|
||||
_container = builder.Build();
|
||||
_ruleManager = _container.Resolve<IRuleManager>();
|
||||
}
|
||||
|
Reference in New Issue
Block a user