Codit / practical-api-guidelines

Practical guidelines for building & designing APIs with .NET.
MIT License
16 stars 5 forks source link

TestCases - use static HttpClient #97

Closed MassimoC closed 5 years ago

MassimoC commented 5 years ago

For each testcase that is executed, you're creating a new HttpClient instance.

It would be better to have it like this:

private static readonly HttpClient Http;

static CarTest()
{
   var srv = new TestServer(.....);

   Http = srv.CreateClient();
}

_Originally posted by @fgheysels