예제 #1
0
        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);
            }
        }
예제 #2
0
        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);
            }
        }