finished writing tests for episodes controller. started writing tests for seasons controller. add http client factory class for integration tests

This commit is contained in:
StevanFreeborn
2022-07-08 16:32:25 -05:00
parent 5985d5d9fc
commit 16fe8039bb
11 changed files with 740 additions and 333 deletions
+20
View File
@@ -0,0 +1,20 @@
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;
}
}
}