public TestWebFactory(FlightStore flightStore) { host = WebHostBuilder(flightStore).Build(); //Create the server host.Start(); AppContext.SetSwitch( "System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true); }
private IHostBuilder WebHostBuilder(FlightStore flightStore) { return(Host.CreateDefaultBuilder() .ConfigureWebHostDefaults(webBuilder => { webBuilder .ConfigureKestrel(c => { c.Listen(IPEndPoint.Parse("0.0.0.0:5001"), l => l.Protocols = HttpProtocols.Http2); }) .UseStartup <Startup>() .ConfigureServices(services => { services.AddSingleton(flightStore); }); })); }
public FlightTests() { _flightStore = new FlightStore(); _testWebFactory = new TestWebFactory(_flightStore); _flightClient = new FlightClient(_testWebFactory.GetChannel()); }