public void BeforeScenario() { lock (_obj) { Evt.WaitOne(); if (_factory == null) { _scenarioContextProvider = new ScenarioContextProvider(); _factory = new CustomWebApplicationFactory <FakeStartup>(c => { c.AddSingleton(_scenarioContextProvider); }); _client = _factory.CreateClient(); } _scenarioContextProvider.SetContext(_scenarioContext); } }
public void BeforeScenario() { lock (_obj) { Evt.WaitOne(); if (_factory == null) { _scenarioContextProvider = new ScenarioContextProvider(); _factory = new CustomWebApplicationFactory <FakeStartup>(c => { c.AddSingleton(_scenarioContextProvider); c.AddSingleton <CaseManagement.Common.Factories.IHttpClientFactory>(new FakeHttpClientFactory(() => _factory.CreateClient())); }); _client = _factory.CreateClient(); } _scenarioContextProvider.SetContext(_scenarioContext); } }