Fix ThemeServiceTests

--HG--
branch : dev
This commit is contained in:
Dave Reed
2010-10-12 16:08:15 -07:00
parent 789b00a0f3
commit 6f61bc590b
3 changed files with 24 additions and 0 deletions

View File

@@ -68,6 +68,7 @@ namespace Orchard.Tests.Modules.Themes.Services {
var context = new DynamicProxyContext();
var builder = new ContainerBuilder();
builder.RegisterModule(new SettingsModule());
builder.RegisterType<StubWorkContextAccessor>().As<IWorkContextAccessor>(); // test
builder.RegisterType<ThemeService>().EnableDynamicProxy(context).As<IThemeService>();
builder.RegisterType<SettingsModuleInterceptor>().As<ISettingsModuleInterceptor>();
builder.RegisterType<SiteService>().As<ISiteService>();

View File

@@ -244,6 +244,7 @@
<Compile Include="Mvc\Routes\UrlPrefixTests.cs" />
<Compile Include="Records\BigRecord.cs" />
<Compile Include="Scripting\ScriptingTests.cs" />
<Compile Include="Stubs\StubWorkContextAccessor.cs" />
<Compile Include="Stubs\StubExtensionManager.cs" />
<Compile Include="Stubs\StubReportsCoordinator.cs" />
<Compile Include="Stubs\StubVirtualPathProvider.cs" />

View File

@@ -0,0 +1,22 @@
using System;
using System.Web;
namespace Orchard.Tests.Stubs {
public class StubWorkContextAccessor : IWorkContextAccessor {
public WorkContext GetContext(HttpContextBase httpContext) {
throw new NotSupportedException();
}
public IWorkContextScope CreateWorkContextScope(HttpContextBase httpContext) {
throw new NotSupportedException();
}
public WorkContext GetContext() {
return null;
}
public IWorkContextScope CreateWorkContextScope() {
throw new NotSupportedException();
}
}
}