diff --git a/server.tests/Http/HttpClientFactory.cs b/server.tests/Http/HttpClientFactory.cs index 8495807..0b6f658 100644 --- a/server.tests/Http/HttpClientFactory.cs +++ b/server.tests/Http/HttpClientFactory.cs @@ -4,8 +4,6 @@ namespace server.tests.Http { internal static class HttpClientFactory { - - public static HttpClient GetHttpClient(int version) { var webAppFactory = new WebApplicationFactory(); diff --git a/server.tests/Options/OptionsFactory.cs b/server.tests/Options/OptionsFactory.cs new file mode 100644 index 0000000..bf62a4c --- /dev/null +++ b/server.tests/Options/OptionsFactory.cs @@ -0,0 +1,15 @@ +using System.Text.Json; + +namespace server.tests.Options +{ + internal static class OptionsFactory + { + public static JsonSerializerOptions GetJsonSerializerOptions() + { + return new JsonSerializerOptions + { + PropertyNameCaseInsensitive = true + }; + } + } +} diff --git a/server.tests/v1/integrationTests/CharactersControllerIntegrationTests.cs b/server.tests/v1/integrationTests/CharactersControllerIntegrationTests.cs index fbcf7f8..eed7250 100644 --- a/server.tests/v1/integrationTests/CharactersControllerIntegrationTests.cs +++ b/server.tests/v1/integrationTests/CharactersControllerIntegrationTests.cs @@ -7,6 +7,7 @@ using System.Net; using System.Text.Json; using server.tests.Helpers; using server.tests.Http; +using server.tests.Options; namespace server.tests.v1.IntegrationTests { @@ -20,10 +21,7 @@ namespace server.tests.v1.IntegrationTests { _client = HttpClientFactory.GetHttpClient(1); - _serializerOptions = new JsonSerializerOptions - { - PropertyNameCaseInsensitive = true - }; + _serializerOptions = OptionsFactory.GetJsonSerializerOptions(); _endpoint = "/api/characters"; } diff --git a/server.tests/v1/integrationTests/EpisodesControllerIntegrationTests.cs b/server.tests/v1/integrationTests/EpisodesControllerIntegrationTests.cs index 7841eb7..c9c8c26 100644 --- a/server.tests/v1/integrationTests/EpisodesControllerIntegrationTests.cs +++ b/server.tests/v1/integrationTests/EpisodesControllerIntegrationTests.cs @@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Mvc; using server.Models; using server.tests.Helpers; using server.tests.Http; +using server.tests.Options; using System.Net; using System.Text.Json; @@ -18,10 +19,7 @@ namespace server.tests.v1.IntegrationTests { _client = HttpClientFactory.GetHttpClient(1); - _serializerOptions = new JsonSerializerOptions - { - PropertyNameCaseInsensitive = true - }; + _serializerOptions = OptionsFactory.GetJsonSerializerOptions(); _endpoint = "/api/episodes"; } diff --git a/server.tests/v1/integrationTests/SeasonsControllerIntegrationTests.cs b/server.tests/v1/integrationTests/SeasonsControllerIntegrationTests.cs index beb4bc1..eae7ed7 100644 --- a/server.tests/v1/integrationTests/SeasonsControllerIntegrationTests.cs +++ b/server.tests/v1/integrationTests/SeasonsControllerIntegrationTests.cs @@ -1,4 +1,5 @@ using server.tests.Http; +using server.tests.Options; using System.Text.Json; namespace server.tests.v1.integrationTests @@ -13,10 +14,7 @@ namespace server.tests.v1.integrationTests { _client = HttpClientFactory.GetHttpClient(1); - _serializerOptions = new JsonSerializerOptions - { - PropertyNameCaseInsensitive = true - }; + _serializerOptions = OptionsFactory.GetJsonSerializerOptions(); _endpoint = "/api/seasons"; } diff --git a/server.tests/v1/unitTests/SeasonsControllerUnitTests.cs b/server.tests/v1/unitTests/SeasonsControllerUnitTests.cs index 1cc72cb..b8ec7bb 100644 --- a/server.tests/v1/unitTests/SeasonsControllerUnitTests.cs +++ b/server.tests/v1/unitTests/SeasonsControllerUnitTests.cs @@ -1,7 +1,6 @@ using Moq; using server.Controllers.v1; using server.Persistence.Repositories; -using System.Runtime.CompilerServices; namespace server.tests.v1.unitTests {