2022-07-08 16:32:25 -05:00
|
|
|
using Microsoft.AspNetCore.Mvc.Testing;
|
|
|
|
|
|
|
|
|
|
namespace server.tests.Http
|
|
|
|
|
{
|
|
|
|
|
internal static class HttpClientFactory
|
|
|
|
|
{
|
2022-07-11 09:36:39 -05:00
|
|
|
public static HttpClient GetClient(int version)
|
2022-07-08 16:32:25 -05:00
|
|
|
{
|
|
|
|
|
var webAppFactory = new WebApplicationFactory<Program>();
|
|
|
|
|
|
|
|
|
|
var client = webAppFactory.CreateDefaultClient();
|
|
|
|
|
|
|
|
|
|
client.DefaultRequestHeaders.Add("x-api-version", version.ToString());
|
|
|
|
|
|
|
|
|
|
return client;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|