- More work related to moving Orchard to Autofac 2.1.

Need to rework the host/shell container spin-off for multitenancy.
Need to rework interception.
dev branch is now broken until the end of this sprint, enjoy the default branch.

--HG--
branch : dev
This commit is contained in:
Suha Can
2010-04-02 15:17:13 -07:00
parent 58abf23453
commit 867aaf943f
56 changed files with 540 additions and 440 deletions

View File

@@ -3,13 +3,10 @@ using System.Linq;
using System.Web.Mvc;
using System.Web.Routing;
using Autofac;
using Autofac.Builder;
using JetBrains.Annotations;
using Moq;
using NUnit.Framework;
using Orchard.Data.Builders;
using Orchard.Environment;
using Orchard.Environment.Configuration;
using Orchard.Environment.ShellBuilders;
using Orchard.Setup.Controllers;
using Orchard.Setup.ViewModels;
using Orchard.UI.Notify;
@@ -18,7 +15,7 @@ namespace Orchard.Tests.Modules.Setup {
[TestFixture, Ignore("this can't be made to work")]
public class SetupControllerTests {
private string _tempFolder;
private IContainer _container;
private ILifetimeScope _container;
[SetUp]
public void Init() {
@@ -27,20 +24,19 @@ namespace Orchard.Tests.Modules.Setup {
Directory.CreateDirectory(_tempFolder);
var hostContainer = OrchardStarter.CreateHostContainer(builder => {
builder.Register(new ControllerBuilder());
builder.Register(new ViewEngineCollection { new WebFormViewEngine() });
builder.Register(new RouteCollection());
builder.Register(new ModelBinderDictionary());
builder.RegisterInstance(new ControllerBuilder());
builder.RegisterInstance(new ViewEngineCollection { new WebFormViewEngine() });
builder.RegisterInstance(new RouteCollection());
builder.RegisterInstance(new ModelBinderDictionary());
});
hostContainer.Resolve<IAppDataFolder>().SetBasePath(_tempFolder);
var host = (DefaultOrchardHost)hostContainer.Resolve<IOrchardHost>();
_container = host.CreateShellContainer();
_container.Build(builder => {
builder.Register<SetupController>();
});
_container = host.CreateShellContainer().BeginLifetimeScope();
var updater = new ContainerUpdater();
updater.RegisterType<SetupController>();
updater.Update(_container);
//var builder = new ContainerBuilder();
//builder.Register<SetupController>();