Ejemplo n.º 1
0
 public TestWebFactory(FlightStore flightStore)
 {
     host = WebHostBuilder(flightStore).Build(); //Create the server
     host.Start();
     AppContext.SetSwitch(
         "System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
 }
Ejemplo n.º 2
0
 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);
         });
     }));
 }
Ejemplo n.º 3
0
 public FlightTests()
 {
     _flightStore    = new FlightStore();
     _testWebFactory = new TestWebFactory(_flightStore);
     _flightClient   = new FlightClient(_testWebFactory.GetChannel());
 }