lamchakchan / RestAssured.Net

A simple testing suite for REST based interfaces
Apache License 2.0
117 stars 48 forks source link

Passing httpClient #18

Closed SbiCA closed 7 years ago

SbiCA commented 7 years ago

Hi all,

Is it possible to pass a HttpClient instance to the SetupContext in order to use TestServer middleware?

Something like this:


  _testServer = new TestServer(new WebHostBuilder()
                .UseStartup<Startup>()
            _httpClient = _testServer.CreateClient();

  public void MyTest()
  {
          var test= new RestAssured()    
                .Given()               
                    .HttpClient(_httpClient)                                      

Thx