21 lines
459 B
C#
21 lines
459 B
C#
using Microsoft.AspNetCore.Mvc.Testing;
|
|||
|
|
|
||
|
|
namespace server.tests.Http
|
||
|
|
{
|
||
|
|
internal static class HttpClientFactory
|
||
|
|
{
|
||
|
|
|
||
|
|
|
||
|
|
public static HttpClient GetHttpClient(int version)
|
||
|
|
{
|
||
|
|
var webAppFactory = new WebApplicationFactory<Program>();
|
||
|
|
|
||
|
|
var client = webAppFactory.CreateDefaultClient();
|
||
|
|
|
||
|
|
client.DefaultRequestHeaders.Add("x-api-version", version.ToString());
|
||
|
|
|
||
|
|
return client;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|