public virtual void BeforeEachTest() { var startup = new TestStartup(); Server = TestServer.Create(builder => startup.Configuration(builder)); MockedApiInstaller = startup.MockedApiInstaller; var documentDbBase = new DocumentDbBase(startup.Container.Resolve<IDocumentStore>(), startup.Container.Resolve<SeedService>()); documentDbBase.Init(); }
public void Configuration(IAppBuilder app) { var startup = new Startup(); MockedApiInstaller = new MockedApiControllerInstaller(); Container = new WindsorContainer(); Container.Kernel.ComponentModelBuilder.AddContributor(new SingletonEqualizer()); Container .Install(MockedApiInstaller) .Install(new ApiControllerInstaller()) .Install(new OAuthInstaller(null)) .Install(new AutoMapperInstaller()) .Install(new DalInstaller()) .Install(new ServiceInstaller()) .Install(new TestWebInstaller(null, startup.HttpConfiguration)); var configurationService = Container.Resolve<IConfigurationService>(); startup.HttpConfiguration.Filters.Add(new ApiKeyActionFilter(configurationService)); startup.InjectTestContainer(() => Container); startup.Configuration(app); }