private readonly AppDomainProxy _appDomainProxy; // The gateway to the ASP.NET-enabled .NET appdomain private AppHost(string appPhysicalDirectory, string virtualDirectory = "/") { _appDomainProxy = (AppDomainProxy)ApplicationHost.CreateApplicationHost(typeof(AppDomainProxy), virtualDirectory, appPhysicalDirectory); _appDomainProxy.RunCodeInAppDomain(() => { InitializeApplication(); FilterProviders.Providers.Add(new InterceptionFilterProvider()); LastRequestData.Reset(); }); }
private AppHost(string appPhysicalDirectory, string virtualDirectory = "/") { try { _appDomainProxy = (AppDomainProxy) ApplicationHost.CreateApplicationHost(typeof (AppDomainProxy), virtualDirectory, appPhysicalDirectory); } catch(FileNotFoundException ex) { if((ex.Message != null) && ex.Message.Contains("MvcIntegrationTestFramework")) throw new InvalidOperationException("Could not load MvcIntegrationTestFramework.dll within a bin directory under " + appPhysicalDirectory + ". Is this the path to your ASP.NET MVC application, and have you set up a post-build event to copy your test assemblies and their dependencies to this folder? See the demo project for an example."); throw; } _appDomainProxy.RunCodeInAppDomain(() => { InitializeApplication(); AttachTestControllerDescriptorsForAllControllers(); LastRequestData.Reset(); }); }
private readonly AppDomainProxy _appDomainProxy; // The gateway to the ASP.NET-enabled .NET appdomain private AppHost(string appPhysicalDirectory, string virtualDirectory = "/") { try { _appDomainProxy = (AppDomainProxy)ApplicationHost.CreateApplicationHost(typeof(AppDomainProxy), virtualDirectory, appPhysicalDirectory); } catch (FileNotFoundException ex) { if ((ex.Message != null) && ex.Message.Contains("MvcIntegrationTestFramework")) { throw new InvalidOperationException("Could not load MvcIntegrationTestFramework.dll within a bin directory under " + appPhysicalDirectory + ". Is this the path to your ASP.NET MVC application, and have you set up a post-build event to copy your test assemblies and their dependencies to this folder? See the demo project for an example."); } throw; } _appDomainProxy.RunCodeInAppDomain(() => { InitializeApplication(); AttachTestControllerDescriptorsForAllControllers(); LastRequestData.Reset(); }); }
private AppHost(string appPhysicalDirectory, string virtualDirectory = "/") { _appDomainProxy = (AppDomainProxy)ApplicationHost.CreateApplicationHost(typeof(AppDomainProxy), virtualDirectory, appPhysicalDirectory); _appDomainProxy.RunCodeInAppDomain((preInit, postInit) => { if (preInit != null) { preInit.Invoke(); } InitializeApplication(); if (postInit != null) { postInit.Invoke(); } FilterProviders.Providers.Add(new InterceptionFilterProvider()); LastRequestData.Reset(); }, _preInit, _postInit); }