From c7964f5d2f94d04aaed156a42d3f5300fa414476 Mon Sep 17 00:00:00 2001 From: maurei Date: Wed, 17 Mar 2021 10:32:44 +0100 Subject: [PATCH 01/18] introducd TestControllerProvider and a base IntegrationTestFixture to configure it in a default fashion --- src/JsonApiDotNetCore/ArgumentGuard.cs | 2 +- .../ContentNegotiation/AcceptHeaderTests.cs | 7 +- .../ContentTypeHeaderTests.cs | 6 +- .../IntegrationTestFixture.cs | 30 ++++++++ .../ResourceHooks/ResourceHooksStartup.cs | 2 +- .../ServiceCollectionExtensions.cs | 15 ---- .../ServiceCollectionExtensions.cs | 70 +++++++++++++++++++ .../TestControllerProvider.cs | 33 +++++++++ 8 files changed, 143 insertions(+), 22 deletions(-) create mode 100644 test/JsonApiDotNetCoreExampleTests/IntegrationTests/IntegrationTestFixture.cs delete mode 100644 test/JsonApiDotNetCoreExampleTests/ServiceCollectionExtensions.cs create mode 100644 test/TestBuildingBlocks/ServiceCollectionExtensions.cs create mode 100644 test/TestBuildingBlocks/TestControllerProvider.cs diff --git a/src/JsonApiDotNetCore/ArgumentGuard.cs b/src/JsonApiDotNetCore/ArgumentGuard.cs index c9f9e2d6a7..f27e260a6d 100644 --- a/src/JsonApiDotNetCore/ArgumentGuard.cs +++ b/src/JsonApiDotNetCore/ArgumentGuard.cs @@ -7,7 +7,7 @@ namespace JsonApiDotNetCore { - internal static class ArgumentGuard + public static class ArgumentGuard { [AssertionMethod] [ContractAnnotation("value: null => halt")] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/AcceptHeaderTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/AcceptHeaderTests.cs index 25ad63189e..05e24683dc 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/AcceptHeaderTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/AcceptHeaderTests.cs @@ -5,21 +5,22 @@ using FluentAssertions; using JsonApiDotNetCore.Middleware; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExample.Controllers; using JsonApiDotNetCoreExampleTests.Startups; using TestBuildingBlocks; using Xunit; namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation { - public sealed class AcceptHeaderTests : IClassFixture, PolicyDbContext>> + public sealed class AcceptHeaderTests : IntegrationTestFixture, PolicyDbContext> { private readonly ExampleIntegrationTestContext, PolicyDbContext> _testContext; - public AcceptHeaderTests(ExampleIntegrationTestContext, PolicyDbContext> testContext) + public AcceptHeaderTests(ExampleIntegrationTestContext, PolicyDbContext> testContext) : base(testContext) { _testContext = testContext; - testContext.ConfigureServicesAfterStartup(services => services.AddControllersFromExampleProject()); + TestControllerProvider.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/ContentTypeHeaderTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/ContentTypeHeaderTests.cs index 3aba63977a..8c28b113fb 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/ContentTypeHeaderTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/ContentTypeHeaderTests.cs @@ -4,21 +4,23 @@ using FluentAssertions; using JsonApiDotNetCore.Middleware; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExample.Controllers; using JsonApiDotNetCoreExampleTests.Startups; using TestBuildingBlocks; using Xunit; namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation { - public sealed class ContentTypeHeaderTests : IClassFixture, PolicyDbContext>> + public sealed class ContentTypeHeaderTests : IntegrationTestFixture, PolicyDbContext> { private readonly ExampleIntegrationTestContext, PolicyDbContext> _testContext; public ContentTypeHeaderTests(ExampleIntegrationTestContext, PolicyDbContext> testContext) + : base(testContext) { _testContext = testContext; - testContext.ConfigureServicesAfterStartup(services => services.AddControllersFromExampleProject()); + TestControllerProvider.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/IntegrationTestFixture.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/IntegrationTestFixture.cs new file mode 100644 index 0000000000..6df771f4bd --- /dev/null +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/IntegrationTestFixture.cs @@ -0,0 +1,30 @@ +using Microsoft.EntityFrameworkCore; +using TestBuildingBlocks; +using Xunit; + +namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation +{ + public class IntegrationTestFixture : IClassFixture> + where TStartup : class + where TDbContext : DbContext + { + protected TestControllerProvider TestControllerProvider = new TestControllerProvider(); + + public IntegrationTestFixture() + { + } + + public IntegrationTestFixture(ExampleIntegrationTestContext testContext) + { + TestControllerProvider.NamespaceEntryPoints.Add(GetType()); + + + testContext.ConfigureServicesBeforeStartup(services => + { + services.RemoveControllerFeatureProviders(); + + services.UseControllers(TestControllerProvider); + }); + } + } +} diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceHooks/ResourceHooksStartup.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceHooks/ResourceHooksStartup.cs index 57974b5ede..52e4187e1c 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceHooks/ResourceHooksStartup.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceHooks/ResourceHooksStartup.cs @@ -14,7 +14,7 @@ public override void ConfigureServices(IServiceCollection services) { base.ConfigureServices(services); - services.AddControllersFromExampleProject(); + // services.AddControllersFromExampleProject(); services.AddClientSerialization(); } diff --git a/test/JsonApiDotNetCoreExampleTests/ServiceCollectionExtensions.cs b/test/JsonApiDotNetCoreExampleTests/ServiceCollectionExtensions.cs deleted file mode 100644 index b0ec80ebe3..0000000000 --- a/test/JsonApiDotNetCoreExampleTests/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,15 +0,0 @@ -using JsonApiDotNetCoreExample.Startups; -using Microsoft.AspNetCore.Mvc.ApplicationParts; -using Microsoft.Extensions.DependencyInjection; - -namespace JsonApiDotNetCoreExampleTests -{ - internal static class ServiceCollectionExtensions - { - public static void AddControllersFromExampleProject(this IServiceCollection services) - { - var part = new AssemblyPart(typeof(EmptyStartup).Assembly); - services.AddMvcCore().ConfigureApplicationPartManager(apm => apm.ApplicationParts.Add(part)); - } - } -} diff --git a/test/TestBuildingBlocks/ServiceCollectionExtensions.cs b/test/TestBuildingBlocks/ServiceCollectionExtensions.cs new file mode 100644 index 0000000000..5ef6fe9545 --- /dev/null +++ b/test/TestBuildingBlocks/ServiceCollectionExtensions.cs @@ -0,0 +1,70 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using JsonApiDotNetCore; +using JsonApiDotNetCore.Services; +using Microsoft.AspNetCore.Mvc.ApplicationParts; +using Microsoft.AspNetCore.Mvc.Controllers; +using Microsoft.Extensions.DependencyInjection; + +namespace TestBuildingBlocks +{ + public static class ServiceCollectionExtensions + { + public static void AddControllersFromExampleProject(this IServiceCollection x) + { + + } + + public static void UseControllers(this IServiceCollection services, TestControllerProvider testControllerProvider) + { + ArgumentGuard.NotNull(services, nameof(services)); + + services.AddMvcCore().ConfigureApplicationPartManager(manager => + { + RemoveExistingControllerFeatureProviders(manager); + AddControllerAssemblies(testControllerProvider, manager); + + manager.FeatureProviders.Add(testControllerProvider); + }); + } + + public static void RemoveControllerFeatureProviders(this IServiceCollection services) + { + ArgumentGuard.NotNull(services, nameof(services)); + + services.AddMvcCore().ConfigureApplicationPartManager(manager => + { + IApplicationFeatureProvider[] providers = manager.FeatureProviders.OfType>() + .ToArray(); + + foreach (IApplicationFeatureProvider provider in providers) + { + manager.FeatureProviders.Remove(provider); + } + }); + } + + private static void AddControllerAssemblies(TestControllerProvider testControllerProvider, ApplicationPartManager manager) + { + HashSet controllerAssemblies = testControllerProvider.NamespaceEntryPoints.Select(type => new AssemblyPart(type.Assembly)).ToHashSet(); + + controllerAssemblies.UnionWith(testControllerProvider.AllowedControllerTypes.Select(type => new AssemblyPart(type.Assembly))); + + foreach (AssemblyPart part in controllerAssemblies) + { + manager.ApplicationParts.Add(part); + } + } + + private static void RemoveExistingControllerFeatureProviders(ApplicationPartManager manager) + { + IApplicationFeatureProvider[] providers = manager.FeatureProviders.OfType>().ToArray(); + + foreach (IApplicationFeatureProvider provider in providers) + { + manager.FeatureProviders.Remove(provider); + } + } + } +} diff --git a/test/TestBuildingBlocks/TestControllerProvider.cs b/test/TestBuildingBlocks/TestControllerProvider.cs new file mode 100644 index 0000000000..12d3e404b1 --- /dev/null +++ b/test/TestBuildingBlocks/TestControllerProvider.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using Microsoft.AspNetCore.Mvc.Controllers; + +namespace TestBuildingBlocks +{ + public sealed class TestControllerProvider : ControllerFeatureProvider + { + public IList NamespaceEntryPoints { get; } = new List(); + public IList AllowedControllerTypes { get; } = new List(); + + private string[] _namespaces; + + public void AddController() + { + AllowedControllerTypes.Add(typeof(TControllerType)); + } + + protected override bool IsController(TypeInfo typeInfo) + { + if (!base.IsController(typeInfo)) + { + return false; + } + + _namespaces ??= NamespaceEntryPoints.Select(type => type.Namespace).ToArray(); + + return AllowedControllerTypes.Contains(typeInfo) || _namespaces.Any(@namespace => typeInfo.Namespace!.StartsWith(@namespace, StringComparison.Ordinal)); + } + } +} From 067c74eacefca7ce4e6fc5b34489411d1d0c9785 Mon Sep 17 00:00:00 2001 From: maurei Date: Wed, 17 Mar 2021 11:24:53 +0100 Subject: [PATCH 02/18] Applied integration test fixture to all integration tests --- ...micConstrainedOperationsControllerTests.cs | 8 +++-- .../Creating/AtomicCreateResourceTests.cs | 8 +++-- ...reateResourceWithClientGeneratedIdTests.cs | 9 +++--- ...eateResourceWithToManyRelationshipTests.cs | 8 +++-- ...reateResourceWithToOneRelationshipTests.cs | 8 +++-- .../Deleting/AtomicDeleteResourceTests.cs | 8 +++-- .../Links/AtomicAbsoluteLinksTests.cs | 10 ++++--- .../AtomicRelativeLinksWithNamespaceTests.cs | 10 ++++--- .../LocalIds/AtomicLocalIdTests.cs | 8 +++-- .../Meta/AtomicResourceMetaTests.cs | 10 ++++--- .../Meta/AtomicResponseMetaTests.cs | 10 ++++--- .../Mixed/AtomicRequestBodyTests.cs | 8 +++-- .../Mixed/MaximumOperationsPerRequestTests.cs | 8 +++-- .../AtomicModelStateValidationTests.cs | 8 +++-- .../QueryStrings/AtomicQueryStringTests.cs | 10 ++++--- ...icSparseFieldSetResourceDefinitionTests.cs | 10 ++++--- .../Transactions/AtomicRollbackTests.cs | 8 +++-- .../AtomicTransactionConsistencyTests.cs | 10 ++++--- .../AtomicAddToToManyRelationshipTests.cs | 8 +++-- ...AtomicRemoveFromToManyRelationshipTests.cs | 8 +++-- .../AtomicReplaceToManyRelationshipTests.cs | 8 +++-- .../AtomicUpdateToOneRelationshipTests.cs | 8 +++-- .../AtomicReplaceToManyRelationshipTests.cs | 8 +++-- .../Resources/AtomicUpdateResourceTests.cs | 8 +++-- .../AtomicUpdateToOneRelationshipTests.cs | 8 +++-- .../CompositeKeys/CompositeKeyTests.cs | 5 ++-- .../ContentNegotiation/AcceptHeaderTests.cs | 3 +- .../ContentTypeHeaderTests.cs | 6 ++-- .../ActionResultTests.cs | 5 ++-- .../ApiControllerAttributeTests.cs | 5 ++-- .../CustomRoutes/CustomRouteTests.cs | 5 ++-- .../EagerLoading/EagerLoadingTests.cs | 5 ++-- .../ExceptionHandlerTests.cs | 5 ++-- .../HostingInIIS/HostingTests.cs | 5 ++-- .../IdObfuscation/IdObfuscationTests.cs | 5 ++-- .../IntegrationTestFixture.cs | 23 ++++----------- .../Links/AbsoluteLinksWithNamespaceTests.cs | 5 ++-- .../AbsoluteLinksWithoutNamespaceTests.cs | 5 ++-- .../Links/LinkInclusionTests.cs | 5 ++-- .../Links/RelativeLinksWithNamespaceTests.cs | 5 ++-- .../RelativeLinksWithoutNamespaceTests.cs | 5 ++-- .../IntegrationTests/Logging/LoggingTests.cs | 5 ++-- .../Meta/ResourceMetaTests.cs | 5 ++-- .../Meta/ResponseMetaTests.cs | 5 ++-- .../Meta/TopLevelCountTests.cs | 5 ++-- .../ModelStateValidationTests.cs | 5 ++-- .../NoModelStateValidationTests.cs | 5 ++-- .../NamingConventions/KebabCasingTests.cs | 5 ++-- .../Filtering/FilterDataTypeTests.cs | 5 ++-- .../Filtering/FilterDepthTests.cs | 5 ++-- .../Filtering/FilterOperatorTests.cs | 5 ++-- .../QueryStrings/Filtering/FilterTests.cs | 5 ++-- .../QueryStrings/Includes/IncludeTests.cs | 5 ++-- .../PaginationWithTotalCountTests.cs | 5 ++-- .../PaginationWithoutTotalCountTests.cs | 5 ++-- .../Pagination/RangeValidationTests.cs | 5 ++-- .../RangeValidationWithMaximumTests.cs | 5 ++-- .../QueryStrings/QueryStringTests.cs | 5 ++-- .../SerializerDefaultValueHandlingTests.cs | 5 ++-- .../SerializerNullValueHandlingTests.cs | 5 ++-- .../QueryStrings/Sorting/SortTests.cs | 5 ++-- .../SparseFieldSets/SparseFieldSetTests.cs | 5 ++-- .../ReadWrite/Creating/CreateResourceTests.cs | 5 ++-- ...reateResourceWithClientGeneratedIdTests.cs | 5 ++-- ...eateResourceWithToManyRelationshipTests.cs | 5 ++-- ...reateResourceWithToOneRelationshipTests.cs | 5 ++-- .../ReadWrite/Deleting/DeleteResourceTests.cs | 5 ++-- .../Fetching/FetchRelationshipTests.cs | 5 ++-- .../ReadWrite/Fetching/FetchResourceTests.cs | 5 ++-- .../AddToToManyRelationshipTests.cs | 5 ++-- .../RemoveFromToManyRelationshipTests.cs | 5 ++-- .../ReplaceToManyRelationshipTests.cs | 5 ++-- .../UpdateToOneRelationshipTests.cs | 5 ++-- .../ReplaceToManyRelationshipTests.cs | 5 ++-- .../Updating/Resources/UpdateResourceTests.cs | 5 ++-- .../Resources/UpdateToOneRelationshipTests.cs | 5 ++-- .../DefaultBehaviorTests.cs | 5 ++-- .../ResourceInjectionTests.cs | 5 ++-- .../ResourceDefinitionQueryCallbackTests.cs | 5 ++-- .../ResourceHooks/ResourceHookTests.cs | 4 +++ .../ResourceInheritance/InheritanceTests.cs | 5 ++-- .../DisableQueryStringTests.cs | 5 ++-- .../HttpReadOnlyTests.cs | 5 ++-- .../NoHttpDeleteTests.cs | 5 ++-- .../RestrictedControllers/NoHttpPatchTests.cs | 5 ++-- .../RestrictedControllers/NoHttpPostTests.cs | 5 ++-- .../Serialization/SerializationTests.cs | 5 ++-- .../SoftDeletion/SoftDeletionTests.cs | 5 ++-- .../ZeroKeys/EmptyGuidAsKeyTests.cs | 5 ++-- .../ZeroKeys/ZeroAsKeyTests.cs | 5 ++-- .../BaseIntegrationTestContext.cs | 18 ++++++++++++ .../ServiceCollectionExtensions.cs | 29 ++++++------------- .../TestControllerProvider.cs | 23 ++++++++++----- 93 files changed, 370 insertions(+), 256 deletions(-) diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Controllers/AtomicConstrainedOperationsControllerTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Controllers/AtomicConstrainedOperationsControllerTests.cs index ba68a661b0..9c98ef6d49 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Controllers/AtomicConstrainedOperationsControllerTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Controllers/AtomicConstrainedOperationsControllerTests.cs @@ -3,6 +3,8 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExample.Controllers; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using TestBuildingBlocks; using Xunit; @@ -10,16 +12,16 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Controllers { public sealed class AtomicConstrainedOperationsControllerTests - : IClassFixture, OperationsDbContext>> + : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicConstrainedOperationsControllerTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + public AtomicConstrainedOperationsControllerTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) { _testContext = testContext; - testContext.ConfigureServicesAfterStartup(services => services.AddControllersFromExampleProject()); + _testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceTests.cs index af4fd37576..7b35a0496d 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceTests.cs @@ -7,6 +7,8 @@ using FluentAssertions; using FluentAssertions.Extensions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExample.Controllers; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -14,16 +16,16 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Creating { - public sealed class AtomicCreateResourceTests : IClassFixture, OperationsDbContext>> + public sealed class AtomicCreateResourceTests : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicCreateResourceTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + public AtomicCreateResourceTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) { _testContext = testContext; - testContext.ConfigureServicesAfterStartup(services => services.AddControllersFromExampleProject()); + _testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithClientGeneratedIdTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithClientGeneratedIdTests.cs index 0bb4edb8e0..14bac5b227 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithClientGeneratedIdTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithClientGeneratedIdTests.cs @@ -5,6 +5,8 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExample.Controllers; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -13,17 +15,16 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Creating { public sealed class AtomicCreateResourceWithClientGeneratedIdTests - : IClassFixture, OperationsDbContext>> + : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); public AtomicCreateResourceWithClientGeneratedIdTests( - ExampleIntegrationTestContext, OperationsDbContext> testContext) + ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) { _testContext = testContext; - - testContext.ConfigureServicesAfterStartup(services => services.AddControllersFromExampleProject()); + _testContext.AddController(); var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService(); options.AllowClientGeneratedIds = true; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToManyRelationshipTests.cs index dd6a0e90c6..57733d13bc 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToManyRelationshipTests.cs @@ -5,6 +5,8 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExample.Controllers; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -13,17 +15,17 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Creating { public sealed class AtomicCreateResourceWithToManyRelationshipTests - : IClassFixture, OperationsDbContext>> + : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); public AtomicCreateResourceWithToManyRelationshipTests( - ExampleIntegrationTestContext, OperationsDbContext> testContext) + ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) { _testContext = testContext; - testContext.ConfigureServicesAfterStartup(services => services.AddControllersFromExampleProject()); + _testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToOneRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToOneRelationshipTests.cs index 21b1aff71b..f7217ab646 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToOneRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToOneRelationshipTests.cs @@ -6,6 +6,8 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExample.Controllers; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using Newtonsoft.Json; @@ -15,17 +17,17 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Creating { public sealed class AtomicCreateResourceWithToOneRelationshipTests - : IClassFixture, OperationsDbContext>> + : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); public AtomicCreateResourceWithToOneRelationshipTests( - ExampleIntegrationTestContext, OperationsDbContext> testContext) + ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) { _testContext = testContext; - testContext.ConfigureServicesAfterStartup(services => services.AddControllersFromExampleProject()); + _testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Deleting/AtomicDeleteResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Deleting/AtomicDeleteResourceTests.cs index ffb3342364..29aab5f40c 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Deleting/AtomicDeleteResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Deleting/AtomicDeleteResourceTests.cs @@ -6,6 +6,8 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExample.Controllers; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -13,16 +15,16 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Deleting { - public sealed class AtomicDeleteResourceTests : IClassFixture, OperationsDbContext>> + public sealed class AtomicDeleteResourceTests : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicDeleteResourceTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + public AtomicDeleteResourceTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) { _testContext = testContext; - testContext.ConfigureServicesAfterStartup(services => services.AddControllersFromExampleProject()); + _testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicAbsoluteLinksTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicAbsoluteLinksTests.cs index 15ebcab128..adf49ae9e3 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicAbsoluteLinksTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicAbsoluteLinksTests.cs @@ -4,6 +4,8 @@ using FluentAssertions; using JsonApiDotNetCore.Resources; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExample.Controllers; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -11,21 +13,21 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Links { - public sealed class AtomicAbsoluteLinksTests : IClassFixture, OperationsDbContext>> + public sealed class AtomicAbsoluteLinksTests : IntegrationTestFixture, OperationsDbContext> { private const string HostPrefix = "http://localhost"; private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicAbsoluteLinksTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + public AtomicAbsoluteLinksTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) { _testContext = testContext; + _testContext.AddController(); + testContext.ConfigureServicesAfterStartup(services => { - services.AddControllersFromExampleProject(); - services.AddScoped(typeof(IResourceChangeTracker<>), typeof(NeverSameResourceChangeTracker<>)); }); } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicRelativeLinksWithNamespaceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicRelativeLinksWithNamespaceTests.cs index 3fea795b67..4edfc5e099 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicRelativeLinksWithNamespaceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicRelativeLinksWithNamespaceTests.cs @@ -5,6 +5,8 @@ using FluentAssertions; using JsonApiDotNetCore.Resources; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExample.Controllers; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -13,19 +15,19 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Links { public sealed class AtomicRelativeLinksWithNamespaceTests - : IClassFixture, OperationsDbContext>> + : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; public AtomicRelativeLinksWithNamespaceTests( - ExampleIntegrationTestContext, OperationsDbContext> testContext) + ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) { _testContext = testContext; + _testContext.AddController(); + testContext.ConfigureServicesAfterStartup(services => { - services.AddControllersFromExampleProject(); - services.AddScoped(typeof(IResourceChangeTracker<>), typeof(NeverSameResourceChangeTracker<>)); }); } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/LocalIds/AtomicLocalIdTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/LocalIds/AtomicLocalIdTests.cs index af3c5ab285..717f145206 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/LocalIds/AtomicLocalIdTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/LocalIds/AtomicLocalIdTests.cs @@ -5,6 +5,8 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExample.Controllers; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -12,16 +14,16 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.LocalIds { - public sealed class AtomicLocalIdTests : IClassFixture, OperationsDbContext>> + public sealed class AtomicLocalIdTests : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicLocalIdTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + public AtomicLocalIdTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) { _testContext = testContext; - testContext.ConfigureServicesAfterStartup(services => services.AddControllersFromExampleProject()); + _testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResourceMetaTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResourceMetaTests.cs index 5e33b822e5..4c6ceaf62f 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResourceMetaTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResourceMetaTests.cs @@ -6,6 +6,8 @@ using FluentAssertions.Extensions; using JsonApiDotNetCore.Resources; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExample.Controllers; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -13,19 +15,19 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Meta { - public sealed class AtomicResourceMetaTests : IClassFixture, OperationsDbContext>> + public sealed class AtomicResourceMetaTests : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicResourceMetaTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + public AtomicResourceMetaTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) { _testContext = testContext; + _testContext.AddController(); + testContext.ConfigureServicesAfterStartup(services => { - services.AddControllersFromExampleProject(); - services.AddScoped, MusicTrackMetaDefinition>(); services.AddScoped, TextLanguageMetaDefinition>(); }); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResponseMetaTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResponseMetaTests.cs index ae24a50a4a..6ba92445f0 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResponseMetaTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResponseMetaTests.cs @@ -6,6 +6,8 @@ using FluentAssertions; using JsonApiDotNetCore.Serialization; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExample.Controllers; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using Newtonsoft.Json.Linq; @@ -14,19 +16,19 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Meta { - public sealed class AtomicResponseMetaTests : IClassFixture, OperationsDbContext>> + public sealed class AtomicResponseMetaTests : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicResponseMetaTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + public AtomicResponseMetaTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) { _testContext = testContext; + _testContext.AddController(); + testContext.ConfigureServicesAfterStartup(services => { - services.AddControllersFromExampleProject(); - services.AddSingleton(); }); } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/AtomicRequestBodyTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/AtomicRequestBodyTests.cs index 7e9453fcd0..f0e32f386b 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/AtomicRequestBodyTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/AtomicRequestBodyTests.cs @@ -4,6 +4,8 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExample.Controllers; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -11,15 +13,15 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Mixed { - public sealed class AtomicRequestBodyTests : IClassFixture, OperationsDbContext>> + public sealed class AtomicRequestBodyTests : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; - public AtomicRequestBodyTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + public AtomicRequestBodyTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) { _testContext = testContext; - testContext.ConfigureServicesAfterStartup(services => services.AddControllersFromExampleProject()); + _testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/MaximumOperationsPerRequestTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/MaximumOperationsPerRequestTests.cs index 84c9f239b7..8d195824c4 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/MaximumOperationsPerRequestTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/MaximumOperationsPerRequestTests.cs @@ -5,6 +5,8 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExample.Controllers; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -13,15 +15,15 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Mixed { public sealed class MaximumOperationsPerRequestTests - : IClassFixture, OperationsDbContext>> + : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; - public MaximumOperationsPerRequestTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + public MaximumOperationsPerRequestTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) { _testContext = testContext; - testContext.ConfigureServicesAfterStartup(services => services.AddControllersFromExampleProject()); + _testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ModelStateValidation/AtomicModelStateValidationTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ModelStateValidation/AtomicModelStateValidationTests.cs index 24d3f851dc..8cb5d074b2 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ModelStateValidation/AtomicModelStateValidationTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ModelStateValidation/AtomicModelStateValidationTests.cs @@ -3,6 +3,8 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExample.Controllers; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -11,16 +13,16 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.ModelStateValidation { public sealed class AtomicModelStateValidationTests - : IClassFixture, OperationsDbContext>> + : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicModelStateValidationTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + public AtomicModelStateValidationTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) { _testContext = testContext; - testContext.ConfigureServicesAfterStartup(services => services.AddControllersFromExampleProject()); + _testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/QueryStrings/AtomicQueryStringTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/QueryStrings/AtomicQueryStringTests.cs index 2e41befd2e..269b70b422 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/QueryStrings/AtomicQueryStringTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/QueryStrings/AtomicQueryStringTests.cs @@ -8,6 +8,8 @@ using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Resources; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExample.Controllers; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.AspNetCore.Authentication; using Microsoft.Extensions.DependencyInjection; @@ -16,21 +18,21 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.QueryStrings { - public sealed class AtomicQueryStringTests : IClassFixture, OperationsDbContext>> + public sealed class AtomicQueryStringTests : IntegrationTestFixture, OperationsDbContext> { private static readonly DateTime FrozenTime = 30.July(2018).At(13, 46, 12); private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicQueryStringTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + public AtomicQueryStringTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) { _testContext = testContext; + _testContext.AddController(); + testContext.ConfigureServicesAfterStartup(services => { - services.AddControllersFromExampleProject(); - services.AddSingleton(new FrozenSystemClock { UtcNow = FrozenTime diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ResourceDefinitions/AtomicSparseFieldSetResourceDefinitionTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ResourceDefinitions/AtomicSparseFieldSetResourceDefinitionTests.cs index de4c1ecaaf..1b9a86175f 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ResourceDefinitions/AtomicSparseFieldSetResourceDefinitionTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ResourceDefinitions/AtomicSparseFieldSetResourceDefinitionTests.cs @@ -5,6 +5,8 @@ using FluentAssertions; using JsonApiDotNetCore.Resources; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExample.Controllers; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -13,19 +15,19 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.ResourceDefinitions { public sealed class AtomicSparseFieldSetResourceDefinitionTests - : IClassFixture, OperationsDbContext>> + : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicSparseFieldSetResourceDefinitionTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + public AtomicSparseFieldSetResourceDefinitionTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) { _testContext = testContext; + _testContext.AddController(); + testContext.ConfigureServicesAfterStartup(services => { - services.AddControllersFromExampleProject(); - services.AddSingleton(); services.AddScoped, LyricTextDefinition>(); services.AddScoped(typeof(IResourceChangeTracker<>), typeof(NeverSameResourceChangeTracker<>)); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicRollbackTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicRollbackTests.cs index e3ff40fb65..c1cf1b62aa 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicRollbackTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicRollbackTests.cs @@ -5,6 +5,8 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExample.Controllers; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -12,16 +14,16 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Transactions { - public sealed class AtomicRollbackTests : IClassFixture, OperationsDbContext>> + public sealed class AtomicRollbackTests : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicRollbackTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + public AtomicRollbackTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) { _testContext = testContext; - testContext.ConfigureServicesAfterStartup(services => services.AddControllersFromExampleProject()); + _testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicTransactionConsistencyTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicTransactionConsistencyTests.cs index 899ee2510d..84fa98a6e2 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicTransactionConsistencyTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicTransactionConsistencyTests.cs @@ -5,6 +5,8 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExample.Controllers; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; @@ -14,18 +16,18 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Transactions { public sealed class AtomicTransactionConsistencyTests - : IClassFixture, OperationsDbContext>> + : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; - public AtomicTransactionConsistencyTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + public AtomicTransactionConsistencyTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) { _testContext = testContext; + _testContext.AddController(); + testContext.ConfigureServicesAfterStartup(services => { - services.AddControllersFromExampleProject(); - services.AddResourceRepository(); services.AddResourceRepository(); services.AddResourceRepository(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicAddToToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicAddToToManyRelationshipTests.cs index 87c407cd41..b736a7d456 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicAddToToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicAddToToManyRelationshipTests.cs @@ -6,6 +6,8 @@ using FluentAssertions; using JsonApiDotNetCore; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExample.Controllers; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -14,16 +16,16 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Updating.Relationships { public sealed class AtomicAddToToManyRelationshipTests - : IClassFixture, OperationsDbContext>> + : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicAddToToManyRelationshipTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + public AtomicAddToToManyRelationshipTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) { _testContext = testContext; - testContext.ConfigureServicesAfterStartup(services => services.AddControllersFromExampleProject()); + _testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicRemoveFromToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicRemoveFromToManyRelationshipTests.cs index 4ba1b44634..afdeb39a47 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicRemoveFromToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicRemoveFromToManyRelationshipTests.cs @@ -6,6 +6,8 @@ using FluentAssertions; using JsonApiDotNetCore; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExample.Controllers; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -14,16 +16,16 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Updating.Relationships { public sealed class AtomicRemoveFromToManyRelationshipTests - : IClassFixture, OperationsDbContext>> + : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicRemoveFromToManyRelationshipTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + public AtomicRemoveFromToManyRelationshipTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) { _testContext = testContext; - testContext.ConfigureServicesAfterStartup(services => services.AddControllersFromExampleProject()); + _testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicReplaceToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicReplaceToManyRelationshipTests.cs index 9eca84249c..e5fb0fd9bc 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicReplaceToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicReplaceToManyRelationshipTests.cs @@ -6,6 +6,8 @@ using FluentAssertions; using JsonApiDotNetCore; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExample.Controllers; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -14,16 +16,16 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Updating.Relationships { public sealed class AtomicReplaceToManyRelationshipTests - : IClassFixture, OperationsDbContext>> + : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicReplaceToManyRelationshipTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + public AtomicReplaceToManyRelationshipTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) { _testContext = testContext; - testContext.ConfigureServicesAfterStartup(services => services.AddControllersFromExampleProject()); + _testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicUpdateToOneRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicUpdateToOneRelationshipTests.cs index 54365fd4da..6b1c733f39 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicUpdateToOneRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicUpdateToOneRelationshipTests.cs @@ -5,6 +5,8 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExample.Controllers; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -13,16 +15,16 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Updating.Relationships { public sealed class AtomicUpdateToOneRelationshipTests - : IClassFixture, OperationsDbContext>> + : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicUpdateToOneRelationshipTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + public AtomicUpdateToOneRelationshipTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) { _testContext = testContext; - testContext.ConfigureServicesAfterStartup(services => services.AddControllersFromExampleProject()); + _testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicReplaceToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicReplaceToManyRelationshipTests.cs index b356585dd2..7a1dd392db 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicReplaceToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicReplaceToManyRelationshipTests.cs @@ -6,6 +6,8 @@ using FluentAssertions; using JsonApiDotNetCore; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExample.Controllers; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -14,16 +16,16 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Updating.Resources { public sealed class AtomicReplaceToManyRelationshipTests - : IClassFixture, OperationsDbContext>> + : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicReplaceToManyRelationshipTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + public AtomicReplaceToManyRelationshipTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) { _testContext = testContext; - testContext.ConfigureServicesAfterStartup(services => services.AddControllersFromExampleProject()); + _testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateResourceTests.cs index 23d106dc3e..503013be54 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateResourceTests.cs @@ -7,6 +7,8 @@ using FluentAssertions; using FluentAssertions.Extensions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExample.Controllers; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -14,16 +16,16 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Updating.Resources { - public sealed class AtomicUpdateResourceTests : IClassFixture, OperationsDbContext>> + public sealed class AtomicUpdateResourceTests : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicUpdateResourceTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + public AtomicUpdateResourceTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) { _testContext = testContext; - testContext.ConfigureServicesAfterStartup(services => services.AddControllersFromExampleProject()); + _testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateToOneRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateToOneRelationshipTests.cs index 52f58e2506..be4e58ac7e 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateToOneRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateToOneRelationshipTests.cs @@ -5,6 +5,8 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExample.Controllers; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -13,16 +15,16 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Updating.Resources { public sealed class AtomicUpdateToOneRelationshipTests - : IClassFixture, OperationsDbContext>> + : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicUpdateToOneRelationshipTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + public AtomicUpdateToOneRelationshipTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) { _testContext = testContext; - testContext.ConfigureServicesAfterStartup(services => services.AddControllersFromExampleProject()); + _testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CompositeKeys/CompositeKeyTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CompositeKeys/CompositeKeyTests.cs index f4453b50c7..4b94196bda 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CompositeKeys/CompositeKeyTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CompositeKeys/CompositeKeyTests.cs @@ -6,6 +6,7 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; @@ -14,11 +15,11 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.CompositeKeys { - public sealed class CompositeKeyTests : IClassFixture, CompositeDbContext>> + public sealed class CompositeKeyTests : IntegrationTestFixture, CompositeDbContext> { private readonly ExampleIntegrationTestContext, CompositeDbContext> _testContext; - public CompositeKeyTests(ExampleIntegrationTestContext, CompositeDbContext> testContext) + public CompositeKeyTests(ExampleIntegrationTestContext, CompositeDbContext> testContext) : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/AcceptHeaderTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/AcceptHeaderTests.cs index 05e24683dc..0458814718 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/AcceptHeaderTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/AcceptHeaderTests.cs @@ -19,8 +19,7 @@ public sealed class AcceptHeaderTests : IntegrationTestFixture, PolicyDbContext> testContext) : base(testContext) { _testContext = testContext; - - TestControllerProvider.AddController(); + _testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/ContentTypeHeaderTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/ContentTypeHeaderTests.cs index 8c28b113fb..339925ae5a 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/ContentTypeHeaderTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/ContentTypeHeaderTests.cs @@ -15,12 +15,10 @@ public sealed class ContentTypeHeaderTests : IntegrationTestFixture, PolicyDbContext> _testContext; - public ContentTypeHeaderTests(ExampleIntegrationTestContext, PolicyDbContext> testContext) - : base(testContext) + public ContentTypeHeaderTests(ExampleIntegrationTestContext, PolicyDbContext> testContext) : base(testContext) { _testContext = testContext; - - TestControllerProvider.AddController(); + _testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ControllerActionResults/ActionResultTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ControllerActionResults/ActionResultTests.cs index dc1d6e3670..1d3e9ca2f7 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ControllerActionResults/ActionResultTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ControllerActionResults/ActionResultTests.cs @@ -3,17 +3,18 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using TestBuildingBlocks; using Xunit; namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ControllerActionResults { - public sealed class ActionResultTests : IClassFixture, ActionResultDbContext>> + public sealed class ActionResultTests : IntegrationTestFixture, ActionResultDbContext> { private readonly ExampleIntegrationTestContext, ActionResultDbContext> _testContext; - public ActionResultTests(ExampleIntegrationTestContext, ActionResultDbContext> testContext) + public ActionResultTests(ExampleIntegrationTestContext, ActionResultDbContext> testContext) : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/ApiControllerAttributeTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/ApiControllerAttributeTests.cs index 8bf3ab0a72..da02861c62 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/ApiControllerAttributeTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/ApiControllerAttributeTests.cs @@ -3,17 +3,18 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using TestBuildingBlocks; using Xunit; namespace JsonApiDotNetCoreExampleTests.IntegrationTests.CustomRoutes { - public sealed class ApiControllerAttributeTests : IClassFixture, CustomRouteDbContext>> + public sealed class ApiControllerAttributeTests : IntegrationTestFixture, CustomRouteDbContext> { private readonly ExampleIntegrationTestContext, CustomRouteDbContext> _testContext; - public ApiControllerAttributeTests(ExampleIntegrationTestContext, CustomRouteDbContext> testContext) + public ApiControllerAttributeTests(ExampleIntegrationTestContext, CustomRouteDbContext> testContext) : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/CustomRouteTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/CustomRouteTests.cs index 9663c6c830..c8acc54b9c 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/CustomRouteTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/CustomRouteTests.cs @@ -5,20 +5,21 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using TestBuildingBlocks; using Xunit; namespace JsonApiDotNetCoreExampleTests.IntegrationTests.CustomRoutes { - public sealed class CustomRouteTests : IClassFixture, CustomRouteDbContext>> + public sealed class CustomRouteTests : IntegrationTestFixture, CustomRouteDbContext> { private const string HostPrefix = "http://localhost"; private readonly ExampleIntegrationTestContext, CustomRouteDbContext> _testContext; private readonly CustomRouteFakers _fakers = new CustomRouteFakers(); - public CustomRouteTests(ExampleIntegrationTestContext, CustomRouteDbContext> testContext) + public CustomRouteTests(ExampleIntegrationTestContext, CustomRouteDbContext> testContext) : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/EagerLoading/EagerLoadingTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/EagerLoading/EagerLoadingTests.cs index 862c6d12fd..3e0fbaafb6 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/EagerLoading/EagerLoadingTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/EagerLoading/EagerLoadingTests.cs @@ -4,6 +4,7 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -11,12 +12,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.EagerLoading { - public sealed class EagerLoadingTests : IClassFixture, EagerLoadingDbContext>> + public sealed class EagerLoadingTests : IntegrationTestFixture, EagerLoadingDbContext> { private readonly ExampleIntegrationTestContext, EagerLoadingDbContext> _testContext; private readonly EagerLoadingFakers _fakers = new EagerLoadingFakers(); - public EagerLoadingTests(ExampleIntegrationTestContext, EagerLoadingDbContext> testContext) + public EagerLoadingTests(ExampleIntegrationTestContext, EagerLoadingDbContext> testContext) : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ExceptionHandling/ExceptionHandlerTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ExceptionHandling/ExceptionHandlerTests.cs index 93801ce51c..934077b7e4 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ExceptionHandling/ExceptionHandlerTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ExceptionHandling/ExceptionHandlerTests.cs @@ -7,6 +7,7 @@ using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Middleware; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; @@ -16,11 +17,11 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ExceptionHandling { - public sealed class ExceptionHandlerTests : IClassFixture, ErrorDbContext>> + public sealed class ExceptionHandlerTests : IntegrationTestFixture, ErrorDbContext> { private readonly ExampleIntegrationTestContext, ErrorDbContext> _testContext; - public ExceptionHandlerTests(ExampleIntegrationTestContext, ErrorDbContext> testContext) + public ExceptionHandlerTests(ExampleIntegrationTestContext, ErrorDbContext> testContext) : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/HostingInIIS/HostingTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/HostingInIIS/HostingTests.cs index 954b59fa5f..784adabf24 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/HostingInIIS/HostingTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/HostingInIIS/HostingTests.cs @@ -4,19 +4,20 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using TestBuildingBlocks; using Xunit; namespace JsonApiDotNetCoreExampleTests.IntegrationTests.HostingInIIS { - public sealed class HostingTests : IClassFixture, HostingDbContext>> + public sealed class HostingTests : IntegrationTestFixture, HostingDbContext> { private const string HostPrefix = "http://localhost"; private readonly ExampleIntegrationTestContext, HostingDbContext> _testContext; private readonly HostingFakers _fakers = new HostingFakers(); - public HostingTests(ExampleIntegrationTestContext, HostingDbContext> testContext) + public HostingTests(ExampleIntegrationTestContext, HostingDbContext> testContext) : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/IdObfuscation/IdObfuscationTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/IdObfuscation/IdObfuscationTests.cs index 99e569f724..6440eb7131 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/IdObfuscation/IdObfuscationTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/IdObfuscation/IdObfuscationTests.cs @@ -4,6 +4,7 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -11,12 +12,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.IdObfuscation { - public sealed class IdObfuscationTests : IClassFixture, ObfuscationDbContext>> + public sealed class IdObfuscationTests : IntegrationTestFixture, ObfuscationDbContext> { private readonly ExampleIntegrationTestContext, ObfuscationDbContext> _testContext; private readonly ObfuscationFakers _fakers = new ObfuscationFakers(); - public IdObfuscationTests(ExampleIntegrationTestContext, ObfuscationDbContext> testContext) + public IdObfuscationTests(ExampleIntegrationTestContext, ObfuscationDbContext> testContext) : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/IntegrationTestFixture.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/IntegrationTestFixture.cs index 6df771f4bd..558e804aad 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/IntegrationTestFixture.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/IntegrationTestFixture.cs @@ -1,30 +1,17 @@ using Microsoft.EntityFrameworkCore; +using Npgsql.TypeHandlers.FullTextSearchHandlers; using TestBuildingBlocks; using Xunit; -namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation +namespace JsonApiDotNetCoreExampleTests.IntegrationTests { - public class IntegrationTestFixture : IClassFixture> + public abstract class IntegrationTestFixture : IClassFixture> where TStartup : class where TDbContext : DbContext { - protected TestControllerProvider TestControllerProvider = new TestControllerProvider(); - - public IntegrationTestFixture() - { - } - - public IntegrationTestFixture(ExampleIntegrationTestContext testContext) + protected IntegrationTestFixture(ExampleIntegrationTestContext testContext) { - TestControllerProvider.NamespaceEntryPoints.Add(GetType()); - - - testContext.ConfigureServicesBeforeStartup(services => - { - services.RemoveControllerFeatureProviders(); - - services.UseControllers(TestControllerProvider); - }); + testContext.AddControllersInNamespaceOf(); } } } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithNamespaceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithNamespaceTests.cs index fdca0b77dd..0ca0eaa4e3 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithNamespaceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithNamespaceTests.cs @@ -6,6 +6,7 @@ using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Resources; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -14,14 +15,14 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Links { public sealed class AbsoluteLinksWithNamespaceTests - : IClassFixture, LinksDbContext>> + : IntegrationTestFixture, LinksDbContext> { private const string HostPrefix = "http://localhost"; private readonly ExampleIntegrationTestContext, LinksDbContext> _testContext; private readonly LinksFakers _fakers = new LinksFakers(); - public AbsoluteLinksWithNamespaceTests(ExampleIntegrationTestContext, LinksDbContext> testContext) + public AbsoluteLinksWithNamespaceTests(ExampleIntegrationTestContext, LinksDbContext> testContext) : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithoutNamespaceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithoutNamespaceTests.cs index e625ae5c55..8648a2544f 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithoutNamespaceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithoutNamespaceTests.cs @@ -6,6 +6,7 @@ using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Resources; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -14,14 +15,14 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Links { public sealed class AbsoluteLinksWithoutNamespaceTests - : IClassFixture, LinksDbContext>> + : IntegrationTestFixture, LinksDbContext> { private const string HostPrefix = "http://localhost"; private readonly ExampleIntegrationTestContext, LinksDbContext> _testContext; private readonly LinksFakers _fakers = new LinksFakers(); - public AbsoluteLinksWithoutNamespaceTests(ExampleIntegrationTestContext, LinksDbContext> testContext) + public AbsoluteLinksWithoutNamespaceTests(ExampleIntegrationTestContext, LinksDbContext> testContext) : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/LinkInclusionTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/LinkInclusionTests.cs index b7838e77e1..23435a0f8c 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/LinkInclusionTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/LinkInclusionTests.cs @@ -3,18 +3,19 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using TestBuildingBlocks; using Xunit; namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Links { - public sealed class LinkInclusionTests : IClassFixture, LinksDbContext>> + public sealed class LinkInclusionTests : IntegrationTestFixture, LinksDbContext> { private readonly ExampleIntegrationTestContext, LinksDbContext> _testContext; private readonly LinksFakers _fakers = new LinksFakers(); - public LinkInclusionTests(ExampleIntegrationTestContext, LinksDbContext> testContext) + public LinkInclusionTests(ExampleIntegrationTestContext, LinksDbContext> testContext) : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithNamespaceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithNamespaceTests.cs index 91fa367b04..31f92a3d04 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithNamespaceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithNamespaceTests.cs @@ -6,6 +6,7 @@ using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Resources; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -14,12 +15,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Links { public sealed class RelativeLinksWithNamespaceTests - : IClassFixture, LinksDbContext>> + : IntegrationTestFixture, LinksDbContext> { private readonly ExampleIntegrationTestContext, LinksDbContext> _testContext; private readonly LinksFakers _fakers = new LinksFakers(); - public RelativeLinksWithNamespaceTests(ExampleIntegrationTestContext, LinksDbContext> testContext) + public RelativeLinksWithNamespaceTests(ExampleIntegrationTestContext, LinksDbContext> testContext) : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithoutNamespaceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithoutNamespaceTests.cs index 13acd8c735..ef7c3e0762 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithoutNamespaceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithoutNamespaceTests.cs @@ -6,6 +6,7 @@ using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Resources; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -14,12 +15,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Links { public sealed class RelativeLinksWithoutNamespaceTests - : IClassFixture, LinksDbContext>> + : IntegrationTestFixture, LinksDbContext> { private readonly ExampleIntegrationTestContext, LinksDbContext> _testContext; private readonly LinksFakers _fakers = new LinksFakers(); - public RelativeLinksWithoutNamespaceTests(ExampleIntegrationTestContext, LinksDbContext> testContext) + public RelativeLinksWithoutNamespaceTests(ExampleIntegrationTestContext, LinksDbContext> testContext) : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Logging/LoggingTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Logging/LoggingTests.cs index 9e9c1085df..fc65fda2cb 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Logging/LoggingTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Logging/LoggingTests.cs @@ -3,6 +3,7 @@ using System.Net.Http; using System.Threading.Tasks; using FluentAssertions; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; @@ -11,12 +12,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Logging { - public sealed class LoggingTests : IClassFixture, AuditDbContext>> + public sealed class LoggingTests : IntegrationTestFixture, AuditDbContext> { private readonly ExampleIntegrationTestContext, AuditDbContext> _testContext; private readonly AuditFakers _fakers = new AuditFakers(); - public LoggingTests(ExampleIntegrationTestContext, AuditDbContext> testContext) + public LoggingTests(ExampleIntegrationTestContext, AuditDbContext> testContext) : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResourceMetaTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResourceMetaTests.cs index c47ab9aaa2..0943637ec5 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResourceMetaTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResourceMetaTests.cs @@ -5,6 +5,7 @@ using FluentAssertions; using JsonApiDotNetCore.Resources; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -12,12 +13,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Meta { - public sealed class ResourceMetaTests : IClassFixture, SupportDbContext>> + public sealed class ResourceMetaTests : IntegrationTestFixture, SupportDbContext> { private readonly ExampleIntegrationTestContext, SupportDbContext> _testContext; private readonly SupportFakers _fakers = new SupportFakers(); - public ResourceMetaTests(ExampleIntegrationTestContext, SupportDbContext> testContext) + public ResourceMetaTests(ExampleIntegrationTestContext, SupportDbContext> testContext) : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResponseMetaTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResponseMetaTests.cs index 5edbc027ee..dbff15144f 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResponseMetaTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResponseMetaTests.cs @@ -4,6 +4,7 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -11,11 +12,11 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Meta { - public sealed class ResponseMetaTests : IClassFixture, SupportDbContext>> + public sealed class ResponseMetaTests : IntegrationTestFixture, SupportDbContext> { private readonly ExampleIntegrationTestContext, SupportDbContext> _testContext; - public ResponseMetaTests(ExampleIntegrationTestContext, SupportDbContext> testContext) + public ResponseMetaTests(ExampleIntegrationTestContext, SupportDbContext> testContext) : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/TopLevelCountTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/TopLevelCountTests.cs index 15df5c055c..eb67abaa2f 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/TopLevelCountTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/TopLevelCountTests.cs @@ -5,6 +5,7 @@ using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Resources; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -12,12 +13,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Meta { - public sealed class TopLevelCountTests : IClassFixture, SupportDbContext>> + public sealed class TopLevelCountTests : IntegrationTestFixture, SupportDbContext> { private readonly ExampleIntegrationTestContext, SupportDbContext> _testContext; private readonly SupportFakers _fakers = new SupportFakers(); - public TopLevelCountTests(ExampleIntegrationTestContext, SupportDbContext> testContext) + public TopLevelCountTests(ExampleIntegrationTestContext, SupportDbContext> testContext) : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/ModelStateValidationTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/ModelStateValidationTests.cs index 84c3bc694c..e1f994be8c 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/ModelStateValidationTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/ModelStateValidationTests.cs @@ -4,6 +4,7 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using TestBuildingBlocks; using Xunit; @@ -11,11 +12,11 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ModelStateValidation { public sealed class ModelStateValidationTests - : IClassFixture, ModelStateDbContext>> + : IntegrationTestFixture, ModelStateDbContext> { private readonly ExampleIntegrationTestContext, ModelStateDbContext> _testContext; - public ModelStateValidationTests(ExampleIntegrationTestContext, ModelStateDbContext> testContext) + public ModelStateValidationTests(ExampleIntegrationTestContext, ModelStateDbContext> testContext) : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/NoModelStateValidationTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/NoModelStateValidationTests.cs index 56e600e6e0..d67ff05626 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/NoModelStateValidationTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/NoModelStateValidationTests.cs @@ -3,17 +3,18 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using TestBuildingBlocks; using Xunit; namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ModelStateValidation { - public sealed class NoModelStateValidationTests : IClassFixture, ModelStateDbContext>> + public sealed class NoModelStateValidationTests : IntegrationTestFixture, ModelStateDbContext> { private readonly ExampleIntegrationTestContext, ModelStateDbContext> _testContext; - public NoModelStateValidationTests(ExampleIntegrationTestContext, ModelStateDbContext> testContext) + public NoModelStateValidationTests(ExampleIntegrationTestContext, ModelStateDbContext> testContext) : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NamingConventions/KebabCasingTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NamingConventions/KebabCasingTests.cs index 1f96742ed1..8521b11150 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NamingConventions/KebabCasingTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NamingConventions/KebabCasingTests.cs @@ -4,17 +4,18 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using TestBuildingBlocks; using Xunit; namespace JsonApiDotNetCoreExampleTests.IntegrationTests.NamingConventions { - public sealed class KebabCasingTests : IClassFixture, SwimmingDbContext>> + public sealed class KebabCasingTests : IntegrationTestFixture, SwimmingDbContext> { private readonly ExampleIntegrationTestContext, SwimmingDbContext> _testContext; private readonly SwimmingFakers _fakers = new SwimmingFakers(); - public KebabCasingTests(ExampleIntegrationTestContext, SwimmingDbContext> testContext) + public KebabCasingTests(ExampleIntegrationTestContext, SwimmingDbContext> testContext) : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDataTypeTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDataTypeTests.cs index e916a303b2..676e0cc4e9 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDataTypeTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDataTypeTests.cs @@ -9,6 +9,7 @@ using Humanizer; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -16,11 +17,11 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.Filtering { - public sealed class FilterDataTypeTests : IClassFixture, FilterDbContext>> + public sealed class FilterDataTypeTests : IntegrationTestFixture, FilterDbContext> { private readonly ExampleIntegrationTestContext, FilterDbContext> _testContext; - public FilterDataTypeTests(ExampleIntegrationTestContext, FilterDbContext> testContext) + public FilterDataTypeTests(ExampleIntegrationTestContext, FilterDbContext> testContext) : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDepthTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDepthTests.cs index fbb02ea6bb..63d5a09330 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDepthTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDepthTests.cs @@ -7,6 +7,7 @@ using FluentAssertions.Extensions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -14,12 +15,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.Filtering { - public sealed class FilterDepthTests : IClassFixture, QueryStringDbContext>> + public sealed class FilterDepthTests : IntegrationTestFixture, QueryStringDbContext> { private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; private readonly QueryStringFakers _fakers = new QueryStringFakers(); - public FilterDepthTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) + public FilterDepthTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterOperatorTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterOperatorTests.cs index 4ee104179e..bc9ea0b14c 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterOperatorTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterOperatorTests.cs @@ -9,6 +9,7 @@ using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Queries.Expressions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -16,11 +17,11 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.Filtering { - public sealed class FilterOperatorTests : IClassFixture, FilterDbContext>> + public sealed class FilterOperatorTests : IntegrationTestFixture, FilterDbContext> { private readonly ExampleIntegrationTestContext, FilterDbContext> _testContext; - public FilterOperatorTests(ExampleIntegrationTestContext, FilterDbContext> testContext) + public FilterOperatorTests(ExampleIntegrationTestContext, FilterDbContext> testContext) : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterTests.cs index 8d45d10ebf..b10d763c0d 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterTests.cs @@ -5,6 +5,7 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -12,12 +13,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.Filtering { - public sealed class FilterTests : IClassFixture, QueryStringDbContext>> + public sealed class FilterTests : IntegrationTestFixture, QueryStringDbContext> { private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; private readonly QueryStringFakers _fakers = new QueryStringFakers(); - public FilterTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) + public FilterTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Includes/IncludeTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Includes/IncludeTests.cs index e9909382e9..eeb5cec128 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Includes/IncludeTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Includes/IncludeTests.cs @@ -6,6 +6,7 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -13,12 +14,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.Includes { - public sealed class IncludeTests : IClassFixture, QueryStringDbContext>> + public sealed class IncludeTests : IntegrationTestFixture, QueryStringDbContext> { private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; private readonly QueryStringFakers _fakers = new QueryStringFakers(); - public IncludeTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) + public IncludeTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithTotalCountTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithTotalCountTests.cs index 648d858d5d..418069e7d6 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithTotalCountTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithTotalCountTests.cs @@ -6,6 +6,7 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -14,7 +15,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.Pagination { public sealed class PaginationWithTotalCountTests - : IClassFixture, QueryStringDbContext>> + : IntegrationTestFixture, QueryStringDbContext> { private const string HostPrefix = "http://localhost"; private const int DefaultPageSize = 5; @@ -22,7 +23,7 @@ public sealed class PaginationWithTotalCountTests private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; private readonly QueryStringFakers _fakers = new QueryStringFakers(); - public PaginationWithTotalCountTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) + public PaginationWithTotalCountTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithoutTotalCountTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithoutTotalCountTests.cs index f45e44daf8..88011068dc 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithoutTotalCountTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithoutTotalCountTests.cs @@ -5,6 +5,7 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -13,7 +14,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.Pagination { public sealed class PaginationWithoutTotalCountTests - : IClassFixture, QueryStringDbContext>> + : IntegrationTestFixture, QueryStringDbContext> { private const string HostPrefix = "http://localhost"; private const int DefaultPageSize = 5; @@ -21,7 +22,7 @@ public sealed class PaginationWithoutTotalCountTests private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; private readonly QueryStringFakers _fakers = new QueryStringFakers(); - public PaginationWithoutTotalCountTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) + public PaginationWithoutTotalCountTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationTests.cs index 3858e78d3f..446b50d5b6 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationTests.cs @@ -5,6 +5,7 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -12,13 +13,13 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.Pagination { - public sealed class RangeValidationTests : IClassFixture, QueryStringDbContext>> + public sealed class RangeValidationTests : IntegrationTestFixture, QueryStringDbContext> { private const int DefaultPageSize = 5; private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; private readonly QueryStringFakers _fakers = new QueryStringFakers(); - public RangeValidationTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) + public RangeValidationTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationWithMaximumTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationWithMaximumTests.cs index b419b9a72e..1e6f2121eb 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationWithMaximumTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationWithMaximumTests.cs @@ -4,6 +4,7 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -12,13 +13,13 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.Pagination { public sealed class RangeValidationWithMaximumTests - : IClassFixture, QueryStringDbContext>> + : IntegrationTestFixture, QueryStringDbContext> { private const int MaximumPageSize = 15; private const int MaximumPageNumber = 20; private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; - public RangeValidationWithMaximumTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) + public RangeValidationWithMaximumTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/QueryStringTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/QueryStringTests.cs index e909ddb443..d659ff5b60 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/QueryStringTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/QueryStringTests.cs @@ -4,6 +4,7 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -11,11 +12,11 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings { - public sealed class QueryStringTests : IClassFixture, QueryStringDbContext>> + public sealed class QueryStringTests : IntegrationTestFixture, QueryStringDbContext> { private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; - public QueryStringTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) + public QueryStringTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerDefaultValueHandlingTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerDefaultValueHandlingTests.cs index 992fc2ed3c..1b33bfc735 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerDefaultValueHandlingTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerDefaultValueHandlingTests.cs @@ -5,6 +5,7 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using Newtonsoft.Json; @@ -14,12 +15,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings { public sealed class SerializerDefaultValueHandlingTests - : IClassFixture, QueryStringDbContext>> + : IntegrationTestFixture, QueryStringDbContext> { private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; private readonly QueryStringFakers _fakers = new QueryStringFakers(); - public SerializerDefaultValueHandlingTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) + public SerializerDefaultValueHandlingTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerNullValueHandlingTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerNullValueHandlingTests.cs index fb23b1b858..dff0c49e6d 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerNullValueHandlingTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerNullValueHandlingTests.cs @@ -5,6 +5,7 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using Newtonsoft.Json; @@ -14,12 +15,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings { public sealed class SerializerNullValueHandlingTests - : IClassFixture, QueryStringDbContext>> + : IntegrationTestFixture, QueryStringDbContext> { private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; private readonly QueryStringFakers _fakers = new QueryStringFakers(); - public SerializerNullValueHandlingTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) + public SerializerNullValueHandlingTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Sorting/SortTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Sorting/SortTests.cs index fd41caa604..eee1d824d4 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Sorting/SortTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Sorting/SortTests.cs @@ -6,18 +6,19 @@ using FluentAssertions; using FluentAssertions.Extensions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using TestBuildingBlocks; using Xunit; namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.Sorting { - public sealed class SortTests : IClassFixture, QueryStringDbContext>> + public sealed class SortTests : IntegrationTestFixture, QueryStringDbContext> { private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; private readonly QueryStringFakers _fakers = new QueryStringFakers(); - public SortTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) + public SortTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SparseFieldSets/SparseFieldSetTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SparseFieldSets/SparseFieldSetTests.cs index ca7052a4ab..112150c968 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SparseFieldSets/SparseFieldSetTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SparseFieldSets/SparseFieldSetTests.cs @@ -6,6 +6,7 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -13,12 +14,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.SparseFieldSets { - public sealed class SparseFieldSetTests : IClassFixture, QueryStringDbContext>> + public sealed class SparseFieldSetTests : IntegrationTestFixture, QueryStringDbContext> { private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; private readonly QueryStringFakers _fakers = new QueryStringFakers(); - public SparseFieldSetTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) + public SparseFieldSetTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceTests.cs index c5f09dea5b..44d1ab61bf 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceTests.cs @@ -9,6 +9,7 @@ using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Resources; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; @@ -17,12 +18,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Creating { - public sealed class CreateResourceTests : IClassFixture, ReadWriteDbContext>> + public sealed class CreateResourceTests : IntegrationTestFixture, ReadWriteDbContext> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); - public CreateResourceTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) + public CreateResourceTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithClientGeneratedIdTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithClientGeneratedIdTests.cs index 95990a7a98..5ee390eeb3 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithClientGeneratedIdTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithClientGeneratedIdTests.cs @@ -7,6 +7,7 @@ using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Resources; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -15,12 +16,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Creating { public sealed class CreateResourceWithClientGeneratedIdTests - : IClassFixture, ReadWriteDbContext>> + : IntegrationTestFixture, ReadWriteDbContext> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); - public CreateResourceWithClientGeneratedIdTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) + public CreateResourceWithClientGeneratedIdTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToManyRelationshipTests.cs index 7083851c00..b4f8324136 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToManyRelationshipTests.cs @@ -5,6 +5,7 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -13,12 +14,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Creating { public sealed class CreateResourceWithToManyRelationshipTests - : IClassFixture, ReadWriteDbContext>> + : IntegrationTestFixture, ReadWriteDbContext> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); - public CreateResourceWithToManyRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) + public CreateResourceWithToManyRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToOneRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToOneRelationshipTests.cs index a6bfc7e262..544ac20eae 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToOneRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToOneRelationshipTests.cs @@ -6,6 +6,7 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; @@ -16,12 +17,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Creating { public sealed class CreateResourceWithToOneRelationshipTests - : IClassFixture, ReadWriteDbContext>> + : IntegrationTestFixture, ReadWriteDbContext> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); - public CreateResourceWithToOneRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) + public CreateResourceWithToOneRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Deleting/DeleteResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Deleting/DeleteResourceTests.cs index 1221029f9b..6bdd475a69 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Deleting/DeleteResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Deleting/DeleteResourceTests.cs @@ -5,6 +5,7 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -12,12 +13,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Deleting { - public sealed class DeleteResourceTests : IClassFixture, ReadWriteDbContext>> + public sealed class DeleteResourceTests : IntegrationTestFixture, ReadWriteDbContext> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); - public DeleteResourceTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) + public DeleteResourceTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchRelationshipTests.cs index de26c720e5..b4d1678ec4 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchRelationshipTests.cs @@ -5,18 +5,19 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using TestBuildingBlocks; using Xunit; namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Fetching { - public sealed class FetchRelationshipTests : IClassFixture, ReadWriteDbContext>> + public sealed class FetchRelationshipTests : IntegrationTestFixture, ReadWriteDbContext> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); - public FetchRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) + public FetchRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchResourceTests.cs index 683c7bbb30..b07bdcedbc 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchResourceTests.cs @@ -5,18 +5,19 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using TestBuildingBlocks; using Xunit; namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Fetching { - public sealed class FetchResourceTests : IClassFixture, ReadWriteDbContext>> + public sealed class FetchResourceTests : IntegrationTestFixture, ReadWriteDbContext> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); - public FetchResourceTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) + public FetchResourceTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/AddToToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/AddToToManyRelationshipTests.cs index fbdd633e95..b0e250e11a 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/AddToToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/AddToToManyRelationshipTests.cs @@ -5,6 +5,7 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -12,12 +13,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Updating.Relationships { - public sealed class AddToToManyRelationshipTests : IClassFixture, ReadWriteDbContext>> + public sealed class AddToToManyRelationshipTests : IntegrationTestFixture, ReadWriteDbContext> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); - public AddToToManyRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) + public AddToToManyRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/RemoveFromToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/RemoveFromToManyRelationshipTests.cs index 61e6c7e887..d527ec07d4 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/RemoveFromToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/RemoveFromToManyRelationshipTests.cs @@ -5,6 +5,7 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -13,12 +14,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Updating.Relationships { public sealed class RemoveFromToManyRelationshipTests - : IClassFixture, ReadWriteDbContext>> + : IntegrationTestFixture, ReadWriteDbContext> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); - public RemoveFromToManyRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) + public RemoveFromToManyRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/ReplaceToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/ReplaceToManyRelationshipTests.cs index 251e5da1ee..c26f977f40 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/ReplaceToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/ReplaceToManyRelationshipTests.cs @@ -5,6 +5,7 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -12,12 +13,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Updating.Relationships { - public sealed class ReplaceToManyRelationshipTests : IClassFixture, ReadWriteDbContext>> + public sealed class ReplaceToManyRelationshipTests : IntegrationTestFixture, ReadWriteDbContext> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); - public ReplaceToManyRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) + public ReplaceToManyRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/UpdateToOneRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/UpdateToOneRelationshipTests.cs index 011bef4e29..79de2b5009 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/UpdateToOneRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/UpdateToOneRelationshipTests.cs @@ -5,6 +5,7 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -12,12 +13,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Updating.Relationships { - public sealed class UpdateToOneRelationshipTests : IClassFixture, ReadWriteDbContext>> + public sealed class UpdateToOneRelationshipTests : IntegrationTestFixture, ReadWriteDbContext> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); - public UpdateToOneRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) + public UpdateToOneRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/ReplaceToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/ReplaceToManyRelationshipTests.cs index 361e77b851..c97ab34eb5 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/ReplaceToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/ReplaceToManyRelationshipTests.cs @@ -6,6 +6,7 @@ using FluentAssertions; using JsonApiDotNetCore; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -13,12 +14,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Updating.Resources { - public sealed class ReplaceToManyRelationshipTests : IClassFixture, ReadWriteDbContext>> + public sealed class ReplaceToManyRelationshipTests : IntegrationTestFixture, ReadWriteDbContext> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); - public ReplaceToManyRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) + public ReplaceToManyRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateResourceTests.cs index 7a9e43d216..6d23dd719d 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateResourceTests.cs @@ -8,6 +8,7 @@ using FluentAssertions; using JsonApiDotNetCore.Resources; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -15,12 +16,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Updating.Resources { - public sealed class UpdateResourceTests : IClassFixture, ReadWriteDbContext>> + public sealed class UpdateResourceTests : IntegrationTestFixture, ReadWriteDbContext> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); - public UpdateResourceTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) + public UpdateResourceTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateToOneRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateToOneRelationshipTests.cs index e2f65d0587..5ce8fd0567 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateToOneRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateToOneRelationshipTests.cs @@ -5,6 +5,7 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -12,12 +13,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Updating.Resources { - public sealed class UpdateToOneRelationshipTests : IClassFixture, ReadWriteDbContext>> + public sealed class UpdateToOneRelationshipTests : IntegrationTestFixture, ReadWriteDbContext> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); - public UpdateToOneRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) + public UpdateToOneRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RequiredRelationships/DefaultBehaviorTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RequiredRelationships/DefaultBehaviorTests.cs index 063d9ed40a..6cfe003d5f 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RequiredRelationships/DefaultBehaviorTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RequiredRelationships/DefaultBehaviorTests.cs @@ -4,6 +4,7 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -11,13 +12,13 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.RequiredRelationships { - public sealed class DefaultBehaviorTests : IClassFixture, DefaultBehaviorDbContext>> + public sealed class DefaultBehaviorTests : IntegrationTestFixture, DefaultBehaviorDbContext> { private readonly ExampleIntegrationTestContext, DefaultBehaviorDbContext> _testContext; private readonly DefaultBehaviorFakers _fakers = new DefaultBehaviorFakers(); - public DefaultBehaviorTests(ExampleIntegrationTestContext, DefaultBehaviorDbContext> testContext) + public DefaultBehaviorTests(ExampleIntegrationTestContext, DefaultBehaviorDbContext> testContext) : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceConstructorInjection/ResourceInjectionTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceConstructorInjection/ResourceInjectionTests.cs index 103ce6eb59..f16527847f 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceConstructorInjection/ResourceInjectionTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceConstructorInjection/ResourceInjectionTests.cs @@ -6,6 +6,7 @@ using FluentAssertions.Common; using FluentAssertions.Extensions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.AspNetCore.Authentication; using Microsoft.EntityFrameworkCore; @@ -15,12 +16,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ResourceConstructorInjection { - public sealed class ResourceInjectionTests : IClassFixture, InjectionDbContext>> + public sealed class ResourceInjectionTests : IntegrationTestFixture, InjectionDbContext> { private readonly ExampleIntegrationTestContext, InjectionDbContext> _testContext; private readonly InjectionFakers _fakers; - public ResourceInjectionTests(ExampleIntegrationTestContext, InjectionDbContext> testContext) + public ResourceInjectionTests(ExampleIntegrationTestContext, InjectionDbContext> testContext) : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceDefinitions/ResourceDefinitionQueryCallbackTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceDefinitions/ResourceDefinitionQueryCallbackTests.cs index 88fe7d09bb..5c02319f62 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceDefinitions/ResourceDefinitionQueryCallbackTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceDefinitions/ResourceDefinitionQueryCallbackTests.cs @@ -7,6 +7,7 @@ using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Resources; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -15,11 +16,11 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ResourceDefinitions { public sealed class ResourceDefinitionQueryCallbackTests - : IClassFixture, CallableDbContext>> + : IntegrationTestFixture, CallableDbContext> { private readonly ExampleIntegrationTestContext, CallableDbContext> _testContext; - public ResourceDefinitionQueryCallbackTests(ExampleIntegrationTestContext, CallableDbContext> testContext) + public ResourceDefinitionQueryCallbackTests(ExampleIntegrationTestContext, CallableDbContext> testContext) : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceHooks/ResourceHookTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceHooks/ResourceHookTests.cs index 60bd69352c..6f752501f8 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceHooks/ResourceHookTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceHooks/ResourceHookTests.cs @@ -13,6 +13,8 @@ using JsonApiDotNetCoreExample.Data; using JsonApiDotNetCoreExample.Definitions; using JsonApiDotNetCoreExample.Models; +using JsonApiDotNetCoreExample.Startups; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using Microsoft.Extensions.DependencyInjection; using Newtonsoft.Json; using TestBuildingBlocks; @@ -20,6 +22,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ResourceHooks { + public sealed class ResourceHookTests : IClassFixture, AppDbContext>> { private readonly ExampleIntegrationTestContext, AppDbContext> _testContext; @@ -28,6 +31,7 @@ public sealed class ResourceHookTests : IClassFixture, AppDbContext> testContext) { _testContext = testContext; + _testContext.AddControllersInNamespaceOf(); testContext.ConfigureServicesAfterStartup(services => { diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceInheritance/InheritanceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceInheritance/InheritanceTests.cs index 0c4e86c39a..94fd57558e 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceInheritance/InheritanceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceInheritance/InheritanceTests.cs @@ -5,6 +5,7 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.IntegrationTests.ResourceInheritance.Models; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; @@ -13,11 +14,11 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ResourceInheritance { - public sealed class InheritanceTests : IClassFixture, InheritanceDbContext>> + public sealed class InheritanceTests : IntegrationTestFixture, InheritanceDbContext> { private readonly ExampleIntegrationTestContext, InheritanceDbContext> _testContext; - public InheritanceTests(ExampleIntegrationTestContext, InheritanceDbContext> testContext) + public InheritanceTests(ExampleIntegrationTestContext, InheritanceDbContext> testContext) : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/DisableQueryStringTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/DisableQueryStringTests.cs index 20e77d2573..30236dd6d2 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/DisableQueryStringTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/DisableQueryStringTests.cs @@ -4,6 +4,7 @@ using FluentAssertions; using JsonApiDotNetCore.QueryStrings; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -11,11 +12,11 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.RestrictedControllers { - public sealed class DisableQueryStringTests : IClassFixture, RestrictionDbContext>> + public sealed class DisableQueryStringTests : IntegrationTestFixture, RestrictionDbContext> { private readonly ExampleIntegrationTestContext, RestrictionDbContext> _testContext; - public DisableQueryStringTests(ExampleIntegrationTestContext, RestrictionDbContext> testContext) + public DisableQueryStringTests(ExampleIntegrationTestContext, RestrictionDbContext> testContext) : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/HttpReadOnlyTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/HttpReadOnlyTests.cs index 9270ad8f0c..eb35b8e68b 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/HttpReadOnlyTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/HttpReadOnlyTests.cs @@ -3,18 +3,19 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using TestBuildingBlocks; using Xunit; namespace JsonApiDotNetCoreExampleTests.IntegrationTests.RestrictedControllers { - public sealed class HttpReadOnlyTests : IClassFixture, RestrictionDbContext>> + public sealed class HttpReadOnlyTests : IntegrationTestFixture, RestrictionDbContext> { private readonly ExampleIntegrationTestContext, RestrictionDbContext> _testContext; private readonly RestrictionFakers _fakers = new RestrictionFakers(); - public HttpReadOnlyTests(ExampleIntegrationTestContext, RestrictionDbContext> testContext) + public HttpReadOnlyTests(ExampleIntegrationTestContext, RestrictionDbContext> testContext) : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpDeleteTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpDeleteTests.cs index 79f3686404..f0f36cf1e1 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpDeleteTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpDeleteTests.cs @@ -3,18 +3,19 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using TestBuildingBlocks; using Xunit; namespace JsonApiDotNetCoreExampleTests.IntegrationTests.RestrictedControllers { - public sealed class NoHttpDeleteTests : IClassFixture, RestrictionDbContext>> + public sealed class NoHttpDeleteTests : IntegrationTestFixture, RestrictionDbContext> { private readonly ExampleIntegrationTestContext, RestrictionDbContext> _testContext; private readonly RestrictionFakers _fakers = new RestrictionFakers(); - public NoHttpDeleteTests(ExampleIntegrationTestContext, RestrictionDbContext> testContext) + public NoHttpDeleteTests(ExampleIntegrationTestContext, RestrictionDbContext> testContext) : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPatchTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPatchTests.cs index 4822ab9198..509a170bfa 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPatchTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPatchTests.cs @@ -3,18 +3,19 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using TestBuildingBlocks; using Xunit; namespace JsonApiDotNetCoreExampleTests.IntegrationTests.RestrictedControllers { - public sealed class NoHttpPatchTests : IClassFixture, RestrictionDbContext>> + public sealed class NoHttpPatchTests : IntegrationTestFixture, RestrictionDbContext> { private readonly ExampleIntegrationTestContext, RestrictionDbContext> _testContext; private readonly RestrictionFakers _fakers = new RestrictionFakers(); - public NoHttpPatchTests(ExampleIntegrationTestContext, RestrictionDbContext> testContext) + public NoHttpPatchTests(ExampleIntegrationTestContext, RestrictionDbContext> testContext) : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPostTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPostTests.cs index b4a5ef5ef6..1758e10cc1 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPostTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPostTests.cs @@ -3,18 +3,19 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using TestBuildingBlocks; using Xunit; namespace JsonApiDotNetCoreExampleTests.IntegrationTests.RestrictedControllers { - public sealed class NoHttpPostTests : IClassFixture, RestrictionDbContext>> + public sealed class NoHttpPostTests : IntegrationTestFixture, RestrictionDbContext> { private readonly ExampleIntegrationTestContext, RestrictionDbContext> _testContext; private readonly RestrictionFakers _fakers = new RestrictionFakers(); - public NoHttpPostTests(ExampleIntegrationTestContext, RestrictionDbContext> testContext) + public NoHttpPostTests(ExampleIntegrationTestContext, RestrictionDbContext> testContext) : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Serialization/SerializationTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Serialization/SerializationTests.cs index 787c37bbef..dc758998d0 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Serialization/SerializationTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Serialization/SerializationTests.cs @@ -8,6 +8,7 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Resources; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using Newtonsoft.Json; @@ -17,12 +18,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Serialization { - public sealed class SerializationTests : IClassFixture, SerializationDbContext>> + public sealed class SerializationTests : IntegrationTestFixture, SerializationDbContext> { private readonly ExampleIntegrationTestContext, SerializationDbContext> _testContext; private readonly SerializationFakers _fakers = new SerializationFakers(); - public SerializationTests(ExampleIntegrationTestContext, SerializationDbContext> testContext) + public SerializationTests(ExampleIntegrationTestContext, SerializationDbContext> testContext) : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/SoftDeletion/SoftDeletionTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/SoftDeletion/SoftDeletionTests.cs index 975a11483a..92c6c21dc6 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/SoftDeletion/SoftDeletionTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/SoftDeletion/SoftDeletionTests.cs @@ -6,6 +6,7 @@ using FluentAssertions; using JsonApiDotNetCore.Resources; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -13,11 +14,11 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.SoftDeletion { - public sealed class SoftDeletionTests : IClassFixture, SoftDeletionDbContext>> + public sealed class SoftDeletionTests : IntegrationTestFixture, SoftDeletionDbContext> { private readonly ExampleIntegrationTestContext, SoftDeletionDbContext> _testContext; - public SoftDeletionTests(ExampleIntegrationTestContext, SoftDeletionDbContext> testContext) + public SoftDeletionTests(ExampleIntegrationTestContext, SoftDeletionDbContext> testContext) : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/EmptyGuidAsKeyTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/EmptyGuidAsKeyTests.cs index 3ce89f3399..14d2d6eb67 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/EmptyGuidAsKeyTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/EmptyGuidAsKeyTests.cs @@ -7,6 +7,7 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; @@ -15,12 +16,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ZeroKeys { - public sealed class EmptyGuidAsKeyTests : IClassFixture, ZeroKeyDbContext>> + public sealed class EmptyGuidAsKeyTests : IntegrationTestFixture, ZeroKeyDbContext> { private readonly ExampleIntegrationTestContext, ZeroKeyDbContext> _testContext; private readonly ZeroKeyFakers _fakers = new ZeroKeyFakers(); - public EmptyGuidAsKeyTests(ExampleIntegrationTestContext, ZeroKeyDbContext> testContext) + public EmptyGuidAsKeyTests(ExampleIntegrationTestContext, ZeroKeyDbContext> testContext) : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/ZeroAsKeyTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/ZeroAsKeyTests.cs index 23c890f1d3..ffc15055d9 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/ZeroAsKeyTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/ZeroAsKeyTests.cs @@ -6,6 +6,7 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; @@ -14,12 +15,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ZeroKeys { - public sealed class ZeroAsKeyTests : IClassFixture, ZeroKeyDbContext>> + public sealed class ZeroAsKeyTests : IntegrationTestFixture, ZeroKeyDbContext> { private readonly ExampleIntegrationTestContext, ZeroKeyDbContext> _testContext; private readonly ZeroKeyFakers _fakers = new ZeroKeyFakers(); - public ZeroAsKeyTests(ExampleIntegrationTestContext, ZeroKeyDbContext> testContext) + public ZeroAsKeyTests(ExampleIntegrationTestContext, ZeroKeyDbContext> testContext) : base(testContext) { _testContext = testContext; diff --git a/test/TestBuildingBlocks/BaseIntegrationTestContext.cs b/test/TestBuildingBlocks/BaseIntegrationTestContext.cs index f4f19af14e..0824ce4474 100644 --- a/test/TestBuildingBlocks/BaseIntegrationTestContext.cs +++ b/test/TestBuildingBlocks/BaseIntegrationTestContext.cs @@ -30,12 +30,28 @@ public abstract class BaseIntegrationTestContext> _lazyFactory; + private readonly TestControllerProvider _testControllerProvider = new TestControllerProvider(); private Action _loggingConfiguration; private Action _beforeServicesConfiguration; private Action _afterServicesConfiguration; public WebApplicationFactory Factory => _lazyFactory.Value; + public void AddController() where TController : class + { + _testControllerProvider.AddController(); + } + + public void AddControllersInNamespaceOf(Type entrypoint) + { + _testControllerProvider.AddNamespaceEntrypoint(entrypoint); + } + + public void AddControllersInNamespaceOf() + { + AddControllersInNamespaceOf(typeof(TNamespaceEntryPoint)); + } + protected BaseIntegrationTestContext() { _lazyFactory = new Lazy>(CreateFactory); @@ -57,6 +73,8 @@ private WebApplicationFactory CreateFactory() factory.ConfigureServicesBeforeStartup(services => { + services.UseControllers(_testControllerProvider); + _beforeServicesConfiguration?.Invoke(services); services.AddDbContext(options => diff --git a/test/TestBuildingBlocks/ServiceCollectionExtensions.cs b/test/TestBuildingBlocks/ServiceCollectionExtensions.cs index 5ef6fe9545..fc679e27ca 100644 --- a/test/TestBuildingBlocks/ServiceCollectionExtensions.cs +++ b/test/TestBuildingBlocks/ServiceCollectionExtensions.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Reflection; using JsonApiDotNetCore; using JsonApiDotNetCore.Services; using Microsoft.AspNetCore.Mvc.ApplicationParts; @@ -11,25 +12,24 @@ namespace TestBuildingBlocks { public static class ServiceCollectionExtensions { - public static void AddControllersFromExampleProject(this IServiceCollection x) - { - - } - - public static void UseControllers(this IServiceCollection services, TestControllerProvider testControllerProvider) + public static void UseControllers(this IServiceCollection services, TestControllerProvider provider) { ArgumentGuard.NotNull(services, nameof(services)); services.AddMvcCore().ConfigureApplicationPartManager(manager => { RemoveExistingControllerFeatureProviders(manager); - AddControllerAssemblies(testControllerProvider, manager); - manager.FeatureProviders.Add(testControllerProvider); + foreach (Assembly assembly in provider.ControllerAssemblies) + { + manager.ApplicationParts.Add(new AssemblyPart(assembly)); + } + + manager.FeatureProviders.Add(provider); }); } - public static void RemoveControllerFeatureProviders(this IServiceCollection services) + private static void RemoveControllerFeatureProviders(this IServiceCollection services) { ArgumentGuard.NotNull(services, nameof(services)); @@ -45,17 +45,6 @@ public static void RemoveControllerFeatureProviders(this IServiceCollection serv }); } - private static void AddControllerAssemblies(TestControllerProvider testControllerProvider, ApplicationPartManager manager) - { - HashSet controllerAssemblies = testControllerProvider.NamespaceEntryPoints.Select(type => new AssemblyPart(type.Assembly)).ToHashSet(); - - controllerAssemblies.UnionWith(testControllerProvider.AllowedControllerTypes.Select(type => new AssemblyPart(type.Assembly))); - - foreach (AssemblyPart part in controllerAssemblies) - { - manager.ApplicationParts.Add(part); - } - } private static void RemoveExistingControllerFeatureProviders(ApplicationPartManager manager) { diff --git a/test/TestBuildingBlocks/TestControllerProvider.cs b/test/TestBuildingBlocks/TestControllerProvider.cs index 12d3e404b1..a4bbaf3ff6 100644 --- a/test/TestBuildingBlocks/TestControllerProvider.cs +++ b/test/TestBuildingBlocks/TestControllerProvider.cs @@ -2,20 +2,29 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; +using Microsoft.AspNetCore.Mvc.ApplicationParts; using Microsoft.AspNetCore.Mvc.Controllers; namespace TestBuildingBlocks { public sealed class TestControllerProvider : ControllerFeatureProvider { - public IList NamespaceEntryPoints { get; } = new List(); - public IList AllowedControllerTypes { get; } = new List(); - + internal readonly ISet ControllerAssemblies = new HashSet(); + private readonly IList _namespaceEntryPoints = new List(); + private readonly IList _allowedControllerTypes = new List(); private string[] _namespaces; - public void AddController() + public void AddController() + { + Type controller = typeof(TController); + _allowedControllerTypes.Add(controller); + ControllerAssemblies.Add(controller.Assembly); + } + + public void AddNamespaceEntrypoint(Type entrypoint) { - AllowedControllerTypes.Add(typeof(TControllerType)); + _namespaceEntryPoints.Add(entrypoint); + ControllerAssemblies.Add(entrypoint.Assembly); } protected override bool IsController(TypeInfo typeInfo) @@ -25,9 +34,9 @@ protected override bool IsController(TypeInfo typeInfo) return false; } - _namespaces ??= NamespaceEntryPoints.Select(type => type.Namespace).ToArray(); + _namespaces ??= _namespaceEntryPoints.Select(type => type.Namespace).ToArray(); - return AllowedControllerTypes.Contains(typeInfo) || _namespaces.Any(@namespace => typeInfo.Namespace!.StartsWith(@namespace, StringComparison.Ordinal)); + return _allowedControllerTypes.Contains(typeInfo) || _namespaces.Any(@namespace => typeInfo.Namespace!.StartsWith(@namespace, StringComparison.Ordinal)); } } } From 718c9b4de4ab5d8d5432bbe59848441d8bb5a026 Mon Sep 17 00:00:00 2001 From: maurei Date: Wed, 17 Mar 2021 11:25:21 +0100 Subject: [PATCH 03/18] improved debugging message from routing convention --- .../Middleware/JsonApiRoutingConvention.cs | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/JsonApiDotNetCore/Middleware/JsonApiRoutingConvention.cs b/src/JsonApiDotNetCore/Middleware/JsonApiRoutingConvention.cs index 80e2aa5dce..d5ec6c4ca9 100644 --- a/src/JsonApiDotNetCore/Middleware/JsonApiRoutingConvention.cs +++ b/src/JsonApiDotNetCore/Middleware/JsonApiRoutingConvention.cs @@ -33,7 +33,7 @@ public class JsonApiRoutingConvention : IJsonApiRoutingConvention { private readonly IJsonApiOptions _options; private readonly IResourceContextProvider _resourceContextProvider; - private readonly HashSet _registeredTemplates = new HashSet(); + private readonly Dictionary _registeredTemplates = new Dictionary(); private readonly Dictionary _resourceContextPerControllerTypeMap = new Dictionary(); public JsonApiRoutingConvention(IJsonApiOptions options, IResourceContextProvider resourceContextProvider) @@ -89,11 +89,14 @@ public void Apply(ApplicationModel application) string template = TemplateFromResource(controller) ?? TemplateFromController(controller); - if (template == null) + if (_registeredTemplates.ContainsKey(template)) { - throw new InvalidConfigurationException($"Controllers with overlapping route templates detected: {controller.ControllerType.FullName}"); + throw new InvalidConfigurationException( + $"Cannot register '{controller.ControllerType.FullName}' for template '{template}' because '{_registeredTemplates[template].ControllerType.FullName}' was already registered for this template."); } + _registeredTemplates.Add(template, controller); + controller.Selectors[0].AttributeRouteModel = new AttributeRouteModel { Template = template @@ -116,10 +119,7 @@ private string TemplateFromResource(ControllerModel model) { string template = $"{_options.Namespace}/{resourceContext.PublicName}"; - if (_registeredTemplates.Add(template)) - { - return template; - } + return template; } return null; @@ -133,12 +133,7 @@ private string TemplateFromController(ControllerModel model) string controllerName = _options.SerializerNamingStrategy.GetPropertyName(model.ControllerName, false); string template = $"{_options.Namespace}/{controllerName}"; - if (_registeredTemplates.Add(template)) - { - return template; - } - - return null; + return template; } /// From b7953804c930e1f8ce2899ca98ed9d93fe78a0ad Mon Sep 17 00:00:00 2001 From: maurei Date: Wed, 17 Mar 2021 11:28:39 +0100 Subject: [PATCH 04/18] fix resource hook tests --- .../IntegrationTests/ResourceHooks/ResourceHookTests.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceHooks/ResourceHookTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceHooks/ResourceHookTests.cs index 6f752501f8..1790e86777 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceHooks/ResourceHookTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceHooks/ResourceHookTests.cs @@ -10,6 +10,7 @@ using JsonApiDotNetCore.Resources; using JsonApiDotNetCore.Serialization.Client.Internal; using JsonApiDotNetCore.Serialization.Objects; +using JsonApiDotNetCoreExample.Controllers; using JsonApiDotNetCoreExample.Data; using JsonApiDotNetCoreExample.Definitions; using JsonApiDotNetCoreExample.Models; @@ -31,7 +32,7 @@ public sealed class ResourceHookTests : IClassFixture, AppDbContext> testContext) { _testContext = testContext; - _testContext.AddControllersInNamespaceOf(); + _testContext.AddControllersInNamespaceOf(); testContext.ConfigureServicesAfterStartup(services => { From 5e249806043467592bdbbaf8ad38d20acacd214c Mon Sep 17 00:00:00 2001 From: maurei Date: Wed, 17 Mar 2021 11:46:52 +0100 Subject: [PATCH 05/18] fix NonJsonApiController tests --- .../ExampleIntegrationTestContext.cs | 6 +++++ .../NonJsonApiController.cs | 2 +- .../NonJsonApiControllerTests.cs | 24 +++++++++++-------- .../BaseIntegrationTestContext.cs | 9 ++++--- test/TestBuildingBlocks/NoModelsDbContext.cs | 14 +++++++++++ 5 files changed, 41 insertions(+), 14 deletions(-) rename {src/Examples/JsonApiDotNetCoreExample/Controllers => test/JsonApiDotNetCoreExampleTests/IntegrationTests/NonJsonApiControllers}/NonJsonApiController.cs (93%) create mode 100644 test/TestBuildingBlocks/NoModelsDbContext.cs diff --git a/test/JsonApiDotNetCoreExampleTests/ExampleIntegrationTestContext.cs b/test/JsonApiDotNetCoreExampleTests/ExampleIntegrationTestContext.cs index 96c92656db..796d16b0f9 100644 --- a/test/JsonApiDotNetCoreExampleTests/ExampleIntegrationTestContext.cs +++ b/test/JsonApiDotNetCoreExampleTests/ExampleIntegrationTestContext.cs @@ -1,5 +1,6 @@ using JetBrains.Annotations; using JsonApiDotNetCoreExample.Startups; +using JsonApiDotNetCoreExampleTests.IntegrationTests; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -20,4 +21,9 @@ public sealed class ExampleIntegrationTestContext : BaseIn where TDbContext : DbContext { } + + public sealed class ExampleIntegrationTestContext : BaseIntegrationTestContext + where TStartup : class + { + } } diff --git a/src/Examples/JsonApiDotNetCoreExample/Controllers/NonJsonApiController.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NonJsonApiControllers/NonJsonApiController.cs similarity index 93% rename from src/Examples/JsonApiDotNetCoreExample/Controllers/NonJsonApiController.cs rename to test/JsonApiDotNetCoreExampleTests/IntegrationTests/NonJsonApiControllers/NonJsonApiController.cs index 49708c5465..052ac3ba4d 100644 --- a/src/Examples/JsonApiDotNetCoreExample/Controllers/NonJsonApiController.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NonJsonApiControllers/NonJsonApiController.cs @@ -2,7 +2,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; -namespace JsonApiDotNetCoreExample.Controllers +namespace JsonApiDotNetCoreExampleTests.IntegrationTests.NonJsonApiControllers { [Route("[controller]")] public sealed class NonJsonApiController : ControllerBase diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NonJsonApiControllers/NonJsonApiControllerTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NonJsonApiControllers/NonJsonApiControllerTests.cs index 19934d7fc3..3d4a535ae9 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NonJsonApiControllers/NonJsonApiControllerTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NonJsonApiControllers/NonJsonApiControllerTests.cs @@ -3,20 +3,24 @@ using System.Net.Http.Headers; using System.Threading.Tasks; using FluentAssertions; +using JsonApiDotNetCoreExample.Controllers; using JsonApiDotNetCoreExample.Startups; using Microsoft.AspNetCore.Mvc.Testing; +using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; using Xunit; namespace JsonApiDotNetCoreExampleTests.IntegrationTests.NonJsonApiControllers { - public sealed class NonJsonApiControllerTests : IClassFixture> + public sealed class NonJsonApiControllerTests : IClassFixture> { - private readonly WebApplicationFactory _factory; + private readonly ExampleIntegrationTestContext _testContext; - public NonJsonApiControllerTests(WebApplicationFactory factory) + public NonJsonApiControllerTests(ExampleIntegrationTestContext testContext) { - _factory = factory; + _testContext = testContext; + + testContext.AddController(); } [Fact] @@ -25,7 +29,7 @@ public async Task Get_skips_middleware_and_formatters() // Arrange using var request = new HttpRequestMessage(HttpMethod.Get, "/NonJsonApi"); - HttpClient client = _factory.CreateClient(); + HttpClient client = _testContext.Factory.CreateClient(); // Act HttpResponseMessage httpResponse = await client.SendAsync(request); @@ -53,7 +57,7 @@ public async Task Post_skips_middleware_and_formatters() } }; - HttpClient client = _factory.CreateClient(); + HttpClient client = _testContext.Factory.CreateClient(); // Act HttpResponseMessage httpResponse = await client.SendAsync(request); @@ -72,7 +76,7 @@ public async Task Post_skips_error_handler() // Arrange using var request = new HttpRequestMessage(HttpMethod.Post, "/NonJsonApi"); - HttpClient client = _factory.CreateClient(); + HttpClient client = _testContext.Factory.CreateClient(); // Act HttpResponseMessage httpResponse = await client.SendAsync(request); @@ -100,7 +104,7 @@ public async Task Put_skips_middleware_and_formatters() } }; - HttpClient client = _factory.CreateClient(); + HttpClient client = _testContext.Factory.CreateClient(); // Act HttpResponseMessage httpResponse = await client.SendAsync(request); @@ -119,7 +123,7 @@ public async Task Patch_skips_middleware_and_formatters() // Arrange using var request = new HttpRequestMessage(HttpMethod.Patch, "/NonJsonApi?name=Janice"); - HttpClient client = _factory.CreateClient(); + HttpClient client = _testContext.Factory.CreateClient(); // Act HttpResponseMessage httpResponse = await client.SendAsync(request); @@ -138,7 +142,7 @@ public async Task Delete_skips_middleware_and_formatters() // Arrange using var request = new HttpRequestMessage(HttpMethod.Delete, "/NonJsonApi"); - HttpClient client = _factory.CreateClient(); + HttpClient client = _testContext.Factory.CreateClient(); // Act HttpResponseMessage httpResponse = await client.SendAsync(request); diff --git a/test/TestBuildingBlocks/BaseIntegrationTestContext.cs b/test/TestBuildingBlocks/BaseIntegrationTestContext.cs index 0824ce4474..b7d0463d86 100644 --- a/test/TestBuildingBlocks/BaseIntegrationTestContext.cs +++ b/test/TestBuildingBlocks/BaseIntegrationTestContext.cs @@ -88,9 +88,12 @@ private WebApplicationFactory CreateFactory() factory.ConfigureServicesAfterStartup(_afterServicesConfiguration); - using IServiceScope scope = factory.Services.CreateScope(); - var dbContext = scope.ServiceProvider.GetRequiredService(); - dbContext.Database.EnsureCreated(); + if (typeof(TDbContext) != typeof(NoModelsDbContext)) + { + using IServiceScope scope = factory.Services.CreateScope(); + var dbContext = scope.ServiceProvider.GetRequiredService(); + dbContext.Database.EnsureCreated(); + } return factory; } diff --git a/test/TestBuildingBlocks/NoModelsDbContext.cs b/test/TestBuildingBlocks/NoModelsDbContext.cs new file mode 100644 index 0000000000..e34d195b21 --- /dev/null +++ b/test/TestBuildingBlocks/NoModelsDbContext.cs @@ -0,0 +1,14 @@ +using JetBrains.Annotations; +using Microsoft.EntityFrameworkCore; + +namespace TestBuildingBlocks +{ + [UsedImplicitly(ImplicitUseTargetFlags.Members)] + public sealed class NoModelsDbContext : DbContext + { + public NoModelsDbContext(DbContextOptions options) + : base(options) + { + } + } +} From a62657e581ff23ae848f111f484329f61dc44b7c Mon Sep 17 00:00:00 2001 From: maurei Date: Wed, 17 Mar 2021 11:53:22 +0100 Subject: [PATCH 06/18] refactor _testContext vs testContext call for better consistency --- src/JsonApiDotNetCore/ArgumentGuard.cs | 8 ++++---- src/JsonApiDotNetCore/Properties/AssemblyInfo.cs | 1 + .../ExampleIntegrationTestContext.cs | 5 ++--- .../AtomicConstrainedOperationsControllerTests.cs | 2 +- .../Creating/AtomicCreateResourceTests.cs | 2 +- .../AtomicCreateResourceWithClientGeneratedIdTests.cs | 3 ++- .../AtomicCreateResourceWithToManyRelationshipTests.cs | 2 +- .../AtomicCreateResourceWithToOneRelationshipTests.cs | 2 +- .../Deleting/AtomicDeleteResourceTests.cs | 2 +- .../AtomicOperations/Links/AtomicAbsoluteLinksTests.cs | 2 +- .../Links/AtomicRelativeLinksWithNamespaceTests.cs | 2 +- .../AtomicOperations/LocalIds/AtomicLocalIdTests.cs | 2 +- .../AtomicOperations/Meta/AtomicResourceMetaTests.cs | 2 +- .../AtomicOperations/Meta/AtomicResponseMetaTests.cs | 2 +- .../AtomicOperations/Mixed/AtomicRequestBodyTests.cs | 2 +- .../Mixed/MaximumOperationsPerRequestTests.cs | 2 +- .../AtomicModelStateValidationTests.cs | 2 +- .../QueryStrings/AtomicQueryStringTests.cs | 2 +- .../AtomicSparseFieldSetResourceDefinitionTests.cs | 2 +- .../AtomicOperations/Transactions/AtomicRollbackTests.cs | 2 +- .../Transactions/AtomicTransactionConsistencyTests.cs | 2 +- .../Relationships/AtomicAddToToManyRelationshipTests.cs | 2 +- .../AtomicRemoveFromToManyRelationshipTests.cs | 2 +- .../AtomicReplaceToManyRelationshipTests.cs | 2 +- .../Relationships/AtomicUpdateToOneRelationshipTests.cs | 2 +- .../Resources/AtomicReplaceToManyRelationshipTests.cs | 2 +- .../Updating/Resources/AtomicUpdateResourceTests.cs | 2 +- .../Resources/AtomicUpdateToOneRelationshipTests.cs | 2 +- .../ContentNegotiation/AcceptHeaderTests.cs | 3 ++- .../ContentNegotiation/ContentTypeHeaderTests.cs | 3 ++- .../IntegrationTests/IntegrationTestFixture.cs | 2 -- .../IntegrationTests/ResourceHooks/ResourceHookTests.cs | 3 ++- test/TestBuildingBlocks/BaseIntegrationTestContext.cs | 9 ++------- test/TestBuildingBlocks/TestControllerProvider.cs | 3 +-- 34 files changed, 42 insertions(+), 46 deletions(-) diff --git a/src/JsonApiDotNetCore/ArgumentGuard.cs b/src/JsonApiDotNetCore/ArgumentGuard.cs index f27e260a6d..a5fe18d178 100644 --- a/src/JsonApiDotNetCore/ArgumentGuard.cs +++ b/src/JsonApiDotNetCore/ArgumentGuard.cs @@ -7,11 +7,11 @@ namespace JsonApiDotNetCore { - public static class ArgumentGuard + internal static class ArgumentGuard { [AssertionMethod] [ContractAnnotation("value: null => halt")] - public static void NotNull([CanBeNull] [NoEnumeration] T value, [NotNull] [InvokerParameterName] string name) + internal static void NotNull([CanBeNull] [NoEnumeration] T value, [NotNull] [InvokerParameterName] string name) where T : class { if (value is null) @@ -22,7 +22,7 @@ public static void NotNull([CanBeNull] [NoEnumeration] T value, [NotNull] [In [AssertionMethod] [ContractAnnotation("value: null => halt")] - public static void NotNullNorEmpty([CanBeNull] IEnumerable value, [NotNull] [InvokerParameterName] string name, + internal static void NotNullNorEmpty([CanBeNull] IEnumerable value, [NotNull] [InvokerParameterName] string name, [CanBeNull] string collectionName = null) { NotNull(value, name); @@ -35,7 +35,7 @@ public static void NotNullNorEmpty([CanBeNull] IEnumerable value, [NotNull [AssertionMethod] [ContractAnnotation("value: null => halt")] - public static void NotNullNorEmpty([CanBeNull] string value, [NotNull] [InvokerParameterName] string name) + internal static void NotNullNorEmpty([CanBeNull] string value, [NotNull] [InvokerParameterName] string name) { NotNull(value, name); diff --git a/src/JsonApiDotNetCore/Properties/AssemblyInfo.cs b/src/JsonApiDotNetCore/Properties/AssemblyInfo.cs index 6bd2e5a870..2c359f920d 100644 --- a/src/JsonApiDotNetCore/Properties/AssemblyInfo.cs +++ b/src/JsonApiDotNetCore/Properties/AssemblyInfo.cs @@ -4,3 +4,4 @@ [assembly: InternalsVisibleTo("JsonApiDotNetCoreExampleTests")] [assembly: InternalsVisibleTo("UnitTests")] [assembly: InternalsVisibleTo("DiscoveryTests")] +[assembly: InternalsVisibleTo("TestBuildingBlocks")] diff --git a/test/JsonApiDotNetCoreExampleTests/ExampleIntegrationTestContext.cs b/test/JsonApiDotNetCoreExampleTests/ExampleIntegrationTestContext.cs index 796d16b0f9..e0a4a6bfdc 100644 --- a/test/JsonApiDotNetCoreExampleTests/ExampleIntegrationTestContext.cs +++ b/test/JsonApiDotNetCoreExampleTests/ExampleIntegrationTestContext.cs @@ -1,6 +1,5 @@ using JetBrains.Annotations; using JsonApiDotNetCoreExample.Startups; -using JsonApiDotNetCoreExampleTests.IntegrationTests; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -16,13 +15,13 @@ namespace JsonApiDotNetCoreExampleTests /// The EF Core database context, which can be defined in the test project. /// [UsedImplicitly(ImplicitUseKindFlags.InstantiatedNoFixedConstructorSignature)] - public sealed class ExampleIntegrationTestContext : BaseIntegrationTestContext + public class ExampleIntegrationTestContext : BaseIntegrationTestContext where TStartup : class where TDbContext : DbContext { } - public sealed class ExampleIntegrationTestContext : BaseIntegrationTestContext + public sealed class ExampleIntegrationTestContext : ExampleIntegrationTestContext where TStartup : class { } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Controllers/AtomicConstrainedOperationsControllerTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Controllers/AtomicConstrainedOperationsControllerTests.cs index 9c98ef6d49..2d6e782c28 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Controllers/AtomicConstrainedOperationsControllerTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Controllers/AtomicConstrainedOperationsControllerTests.cs @@ -21,7 +21,7 @@ public AtomicConstrainedOperationsControllerTests(ExampleIntegrationTestContext< { _testContext = testContext; - _testContext.AddController(); + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceTests.cs index 7b35a0496d..def31fd094 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceTests.cs @@ -25,7 +25,7 @@ public AtomicCreateResourceTests(ExampleIntegrationTestContext(); + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithClientGeneratedIdTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithClientGeneratedIdTests.cs index 14bac5b227..4936b9ada4 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithClientGeneratedIdTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithClientGeneratedIdTests.cs @@ -24,7 +24,8 @@ public AtomicCreateResourceWithClientGeneratedIdTests( ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) { _testContext = testContext; - _testContext.AddController(); + + testContext.AddController(); var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService(); options.AllowClientGeneratedIds = true; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToManyRelationshipTests.cs index 57733d13bc..26bf9bde4b 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToManyRelationshipTests.cs @@ -25,7 +25,7 @@ public AtomicCreateResourceWithToManyRelationshipTests( { _testContext = testContext; - _testContext.AddController(); + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToOneRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToOneRelationshipTests.cs index f7217ab646..22a3c676e0 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToOneRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToOneRelationshipTests.cs @@ -27,7 +27,7 @@ public AtomicCreateResourceWithToOneRelationshipTests( { _testContext = testContext; - _testContext.AddController(); + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Deleting/AtomicDeleteResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Deleting/AtomicDeleteResourceTests.cs index 29aab5f40c..7c40439890 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Deleting/AtomicDeleteResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Deleting/AtomicDeleteResourceTests.cs @@ -24,7 +24,7 @@ public AtomicDeleteResourceTests(ExampleIntegrationTestContext(); + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicAbsoluteLinksTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicAbsoluteLinksTests.cs index adf49ae9e3..e3e0b90982 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicAbsoluteLinksTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicAbsoluteLinksTests.cs @@ -24,7 +24,7 @@ public AtomicAbsoluteLinksTests(ExampleIntegrationTestContext(); + testContext.AddController(); testContext.ConfigureServicesAfterStartup(services => { diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicRelativeLinksWithNamespaceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicRelativeLinksWithNamespaceTests.cs index 4edfc5e099..fc647250e7 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicRelativeLinksWithNamespaceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicRelativeLinksWithNamespaceTests.cs @@ -24,7 +24,7 @@ public AtomicRelativeLinksWithNamespaceTests( { _testContext = testContext; - _testContext.AddController(); + testContext.AddController(); testContext.ConfigureServicesAfterStartup(services => { diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/LocalIds/AtomicLocalIdTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/LocalIds/AtomicLocalIdTests.cs index 717f145206..1abe63708d 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/LocalIds/AtomicLocalIdTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/LocalIds/AtomicLocalIdTests.cs @@ -23,7 +23,7 @@ public AtomicLocalIdTests(ExampleIntegrationTestContext(); + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResourceMetaTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResourceMetaTests.cs index 4c6ceaf62f..9a055762d8 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResourceMetaTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResourceMetaTests.cs @@ -24,7 +24,7 @@ public AtomicResourceMetaTests(ExampleIntegrationTestContext(); + testContext.AddController(); testContext.ConfigureServicesAfterStartup(services => { diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResponseMetaTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResponseMetaTests.cs index 6ba92445f0..1ad52a979d 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResponseMetaTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResponseMetaTests.cs @@ -25,7 +25,7 @@ public AtomicResponseMetaTests(ExampleIntegrationTestContext(); + testContext.AddController(); testContext.ConfigureServicesAfterStartup(services => { diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/AtomicRequestBodyTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/AtomicRequestBodyTests.cs index f0e32f386b..76f6e16237 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/AtomicRequestBodyTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/AtomicRequestBodyTests.cs @@ -21,7 +21,7 @@ public AtomicRequestBodyTests(ExampleIntegrationTestContext(); + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/MaximumOperationsPerRequestTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/MaximumOperationsPerRequestTests.cs index 8d195824c4..10207f8b75 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/MaximumOperationsPerRequestTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/MaximumOperationsPerRequestTests.cs @@ -23,7 +23,7 @@ public MaximumOperationsPerRequestTests(ExampleIntegrationTestContext(); + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ModelStateValidation/AtomicModelStateValidationTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ModelStateValidation/AtomicModelStateValidationTests.cs index 8cb5d074b2..9ef7954076 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ModelStateValidation/AtomicModelStateValidationTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ModelStateValidation/AtomicModelStateValidationTests.cs @@ -22,7 +22,7 @@ public AtomicModelStateValidationTests(ExampleIntegrationTestContext(); + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/QueryStrings/AtomicQueryStringTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/QueryStrings/AtomicQueryStringTests.cs index 269b70b422..39c8d39d77 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/QueryStrings/AtomicQueryStringTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/QueryStrings/AtomicQueryStringTests.cs @@ -29,7 +29,7 @@ public AtomicQueryStringTests(ExampleIntegrationTestContext(); + testContext.AddController(); testContext.ConfigureServicesAfterStartup(services => { diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ResourceDefinitions/AtomicSparseFieldSetResourceDefinitionTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ResourceDefinitions/AtomicSparseFieldSetResourceDefinitionTests.cs index 1b9a86175f..3df84650cf 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ResourceDefinitions/AtomicSparseFieldSetResourceDefinitionTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ResourceDefinitions/AtomicSparseFieldSetResourceDefinitionTests.cs @@ -24,7 +24,7 @@ public AtomicSparseFieldSetResourceDefinitionTests(ExampleIntegrationTestContext { _testContext = testContext; - _testContext.AddController(); + testContext.AddController(); testContext.ConfigureServicesAfterStartup(services => { diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicRollbackTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicRollbackTests.cs index c1cf1b62aa..ced90a34c7 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicRollbackTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicRollbackTests.cs @@ -23,7 +23,7 @@ public AtomicRollbackTests(ExampleIntegrationTestContext(); + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicTransactionConsistencyTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicTransactionConsistencyTests.cs index 84fa98a6e2..9c644fb1b8 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicTransactionConsistencyTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicTransactionConsistencyTests.cs @@ -24,7 +24,7 @@ public AtomicTransactionConsistencyTests(ExampleIntegrationTestContext(); + testContext.AddController(); testContext.ConfigureServicesAfterStartup(services => { diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicAddToToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicAddToToManyRelationshipTests.cs index b736a7d456..b45c4cbcf8 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicAddToToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicAddToToManyRelationshipTests.cs @@ -25,7 +25,7 @@ public AtomicAddToToManyRelationshipTests(ExampleIntegrationTestContext(); + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicRemoveFromToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicRemoveFromToManyRelationshipTests.cs index afdeb39a47..6ead9753c7 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicRemoveFromToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicRemoveFromToManyRelationshipTests.cs @@ -25,7 +25,7 @@ public AtomicRemoveFromToManyRelationshipTests(ExampleIntegrationTestContext(); + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicReplaceToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicReplaceToManyRelationshipTests.cs index e5fb0fd9bc..7e40531998 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicReplaceToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicReplaceToManyRelationshipTests.cs @@ -25,7 +25,7 @@ public AtomicReplaceToManyRelationshipTests(ExampleIntegrationTestContext(); + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicUpdateToOneRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicUpdateToOneRelationshipTests.cs index 6b1c733f39..05d293ac82 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicUpdateToOneRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicUpdateToOneRelationshipTests.cs @@ -24,7 +24,7 @@ public AtomicUpdateToOneRelationshipTests(ExampleIntegrationTestContext(); + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicReplaceToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicReplaceToManyRelationshipTests.cs index 7a1dd392db..fc2e5db999 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicReplaceToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicReplaceToManyRelationshipTests.cs @@ -25,7 +25,7 @@ public AtomicReplaceToManyRelationshipTests(ExampleIntegrationTestContext(); + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateResourceTests.cs index 503013be54..4af52e4e2a 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateResourceTests.cs @@ -25,7 +25,7 @@ public AtomicUpdateResourceTests(ExampleIntegrationTestContext(); + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateToOneRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateToOneRelationshipTests.cs index be4e58ac7e..3dc345115f 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateToOneRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateToOneRelationshipTests.cs @@ -24,7 +24,7 @@ public AtomicUpdateToOneRelationshipTests(ExampleIntegrationTestContext(); + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/AcceptHeaderTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/AcceptHeaderTests.cs index 0458814718..9d24291191 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/AcceptHeaderTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/AcceptHeaderTests.cs @@ -19,7 +19,8 @@ public sealed class AcceptHeaderTests : IntegrationTestFixture, PolicyDbContext> testContext) : base(testContext) { _testContext = testContext; - _testContext.AddController(); + + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/ContentTypeHeaderTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/ContentTypeHeaderTests.cs index 339925ae5a..43746e0d1c 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/ContentTypeHeaderTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/ContentTypeHeaderTests.cs @@ -18,7 +18,8 @@ public sealed class ContentTypeHeaderTests : IntegrationTestFixture, PolicyDbContext> testContext) : base(testContext) { _testContext = testContext; - _testContext.AddController(); + + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/IntegrationTestFixture.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/IntegrationTestFixture.cs index 558e804aad..1a93955d0c 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/IntegrationTestFixture.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/IntegrationTestFixture.cs @@ -1,6 +1,4 @@ using Microsoft.EntityFrameworkCore; -using Npgsql.TypeHandlers.FullTextSearchHandlers; -using TestBuildingBlocks; using Xunit; namespace JsonApiDotNetCoreExampleTests.IntegrationTests diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceHooks/ResourceHookTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceHooks/ResourceHookTests.cs index 1790e86777..a281679d05 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceHooks/ResourceHookTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceHooks/ResourceHookTests.cs @@ -32,7 +32,8 @@ public sealed class ResourceHookTests : IClassFixture, AppDbContext> testContext) { _testContext = testContext; - _testContext.AddControllersInNamespaceOf(); + + testContext.AddControllersInNamespaceOf(); testContext.ConfigureServicesAfterStartup(services => { diff --git a/test/TestBuildingBlocks/BaseIntegrationTestContext.cs b/test/TestBuildingBlocks/BaseIntegrationTestContext.cs index b7d0463d86..7ee21f18de 100644 --- a/test/TestBuildingBlocks/BaseIntegrationTestContext.cs +++ b/test/TestBuildingBlocks/BaseIntegrationTestContext.cs @@ -39,17 +39,12 @@ public abstract class BaseIntegrationTestContext() where TController : class { - _testControllerProvider.AddController(); - } - - public void AddControllersInNamespaceOf(Type entrypoint) - { - _testControllerProvider.AddNamespaceEntrypoint(entrypoint); + _testControllerProvider.AddController(typeof(TController)); } public void AddControllersInNamespaceOf() { - AddControllersInNamespaceOf(typeof(TNamespaceEntryPoint)); + _testControllerProvider.AddNamespaceEntrypoint(typeof(TNamespaceEntryPoint)); } protected BaseIntegrationTestContext() diff --git a/test/TestBuildingBlocks/TestControllerProvider.cs b/test/TestBuildingBlocks/TestControllerProvider.cs index a4bbaf3ff6..eb8a2ee3b5 100644 --- a/test/TestBuildingBlocks/TestControllerProvider.cs +++ b/test/TestBuildingBlocks/TestControllerProvider.cs @@ -14,9 +14,8 @@ public sealed class TestControllerProvider : ControllerFeatureProvider private readonly IList _allowedControllerTypes = new List(); private string[] _namespaces; - public void AddController() + public void AddController(Type controller) { - Type controller = typeof(TController); _allowedControllerTypes.Add(controller); ControllerAssemblies.Add(controller.Assembly); } From a0e0a8884532362b66da46ddd79eaf676e8aef7b Mon Sep 17 00:00:00 2001 From: maurei Date: Wed, 17 Mar 2021 12:00:30 +0100 Subject: [PATCH 07/18] code cleanup --- .../AtomicConstrainedOperationsControllerTests.cs | 7 +++---- .../AtomicOperations/Creating/AtomicCreateResourceTests.cs | 4 ++-- .../AtomicCreateResourceWithClientGeneratedIdTests.cs | 7 +++---- .../AtomicCreateResourceWithToManyRelationshipTests.cs | 7 +++---- .../AtomicCreateResourceWithToOneRelationshipTests.cs | 7 +++---- .../AtomicOperations/Deleting/AtomicDeleteResourceTests.cs | 4 ++-- .../AtomicOperations/Links/AtomicAbsoluteLinksTests.cs | 4 ++-- .../Links/AtomicRelativeLinksWithNamespaceTests.cs | 4 ++-- .../AtomicOperations/LocalIds/AtomicLocalIdTests.cs | 4 ++-- .../AtomicOperations/Meta/AtomicResourceMetaTests.cs | 4 ++-- .../AtomicOperations/Meta/AtomicResponseMetaTests.cs | 4 ++-- .../AtomicOperations/Mixed/AtomicRequestBodyTests.cs | 4 ++-- .../Mixed/MaximumOperationsPerRequestTests.cs | 7 +++---- .../AtomicModelStateValidationTests.cs | 7 +++---- .../QueryStrings/AtomicQueryStringTests.cs | 4 ++-- .../AtomicSparseFieldSetResourceDefinitionTests.cs | 7 +++---- .../AtomicOperations/Transactions/AtomicRollbackTests.cs | 4 ++-- .../Transactions/AtomicTransactionConsistencyTests.cs | 7 +++---- .../Relationships/AtomicAddToToManyRelationshipTests.cs | 7 +++---- .../AtomicRemoveFromToManyRelationshipTests.cs | 7 +++---- .../Relationships/AtomicReplaceToManyRelationshipTests.cs | 7 +++---- .../Relationships/AtomicUpdateToOneRelationshipTests.cs | 7 +++---- .../Resources/AtomicReplaceToManyRelationshipTests.cs | 7 +++---- .../Updating/Resources/AtomicUpdateResourceTests.cs | 4 ++-- .../Resources/AtomicUpdateToOneRelationshipTests.cs | 7 +++---- .../IntegrationTests/CompositeKeys/CompositeKeyTests.cs | 4 ++-- .../ContentNegotiation/AcceptHeaderTests.cs | 3 ++- .../ContentNegotiation/ContentTypeHeaderTests.cs | 3 ++- .../ControllerActionResults/ActionResultTests.cs | 4 ++-- .../CustomRoutes/ApiControllerAttributeTests.cs | 4 ++-- .../IntegrationTests/CustomRoutes/CustomRouteTests.cs | 4 ++-- .../IntegrationTests/EagerLoading/EagerLoadingTests.cs | 4 ++-- .../ExceptionHandling/ExceptionHandlerTests.cs | 4 ++-- .../IntegrationTests/HostingInIIS/HostingTests.cs | 4 ++-- .../IntegrationTests/IdObfuscation/IdObfuscationTests.cs | 4 ++-- .../Links/AbsoluteLinksWithNamespaceTests.cs | 7 +++---- .../Links/AbsoluteLinksWithoutNamespaceTests.cs | 7 +++---- .../IntegrationTests/Links/LinkInclusionTests.cs | 4 ++-- .../Links/RelativeLinksWithNamespaceTests.cs | 7 +++---- .../Links/RelativeLinksWithoutNamespaceTests.cs | 7 +++---- .../IntegrationTests/Logging/LoggingTests.cs | 4 ++-- .../IntegrationTests/Meta/ResourceMetaTests.cs | 4 ++-- .../IntegrationTests/Meta/ResponseMetaTests.cs | 4 ++-- .../IntegrationTests/Meta/TopLevelCountTests.cs | 4 ++-- .../ModelStateValidation/ModelStateValidationTests.cs | 7 +++---- .../ModelStateValidation/NoModelStateValidationTests.cs | 4 ++-- .../IntegrationTests/NamingConventions/KebabCasingTests.cs | 4 ++-- .../NonJsonApiControllers/NonJsonApiControllerTests.cs | 3 --- .../QueryStrings/Filtering/FilterDataTypeTests.cs | 4 ++-- .../QueryStrings/Filtering/FilterDepthTests.cs | 4 ++-- .../QueryStrings/Filtering/FilterOperatorTests.cs | 4 ++-- .../IntegrationTests/QueryStrings/Filtering/FilterTests.cs | 4 ++-- .../IntegrationTests/QueryStrings/Includes/IncludeTests.cs | 4 ++-- .../Pagination/PaginationWithTotalCountTests.cs | 7 +++---- .../Pagination/PaginationWithoutTotalCountTests.cs | 7 +++---- .../QueryStrings/Pagination/RangeValidationTests.cs | 4 ++-- .../Pagination/RangeValidationWithMaximumTests.cs | 7 +++---- .../IntegrationTests/QueryStrings/QueryStringTests.cs | 4 ++-- .../QueryStrings/SerializerDefaultValueHandlingTests.cs | 7 +++---- .../QueryStrings/SerializerNullValueHandlingTests.cs | 7 +++---- .../IntegrationTests/QueryStrings/Sorting/SortTests.cs | 4 ++-- .../QueryStrings/SparseFieldSets/SparseFieldSetTests.cs | 4 ++-- .../ReadWrite/Creating/CreateResourceTests.cs | 4 ++-- .../Creating/CreateResourceWithClientGeneratedIdTests.cs | 7 +++---- .../Creating/CreateResourceWithToManyRelationshipTests.cs | 7 +++---- .../Creating/CreateResourceWithToOneRelationshipTests.cs | 7 +++---- .../ReadWrite/Deleting/DeleteResourceTests.cs | 4 ++-- .../ReadWrite/Fetching/FetchRelationshipTests.cs | 4 ++-- .../ReadWrite/Fetching/FetchResourceTests.cs | 4 ++-- .../Updating/Relationships/AddToToManyRelationshipTests.cs | 4 ++-- .../Relationships/RemoveFromToManyRelationshipTests.cs | 7 +++---- .../Relationships/ReplaceToManyRelationshipTests.cs | 4 ++-- .../Updating/Relationships/UpdateToOneRelationshipTests.cs | 4 ++-- .../Updating/Resources/ReplaceToManyRelationshipTests.cs | 4 ++-- .../ReadWrite/Updating/Resources/UpdateResourceTests.cs | 4 ++-- .../Updating/Resources/UpdateToOneRelationshipTests.cs | 4 ++-- .../RequiredRelationships/DefaultBehaviorTests.cs | 4 ++-- .../ResourceConstructorInjection/ResourceInjectionTests.cs | 4 ++-- .../ResourceDefinitionQueryCallbackTests.cs | 7 +++---- .../IntegrationTests/ResourceHooks/ResourceHookTests.cs | 3 --- .../ResourceInheritance/InheritanceTests.cs | 4 ++-- .../RestrictedControllers/DisableQueryStringTests.cs | 4 ++-- .../RestrictedControllers/HttpReadOnlyTests.cs | 4 ++-- .../RestrictedControllers/NoHttpDeleteTests.cs | 4 ++-- .../RestrictedControllers/NoHttpPatchTests.cs | 4 ++-- .../RestrictedControllers/NoHttpPostTests.cs | 4 ++-- .../IntegrationTests/Serialization/SerializationTests.cs | 4 ++-- .../IntegrationTests/SoftDeletion/SoftDeletionTests.cs | 4 ++-- .../IntegrationTests/ZeroKeys/EmptyGuidAsKeyTests.cs | 4 ++-- .../IntegrationTests/ZeroKeys/ZeroAsKeyTests.cs | 4 ++-- 90 files changed, 205 insertions(+), 238 deletions(-) diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Controllers/AtomicConstrainedOperationsControllerTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Controllers/AtomicConstrainedOperationsControllerTests.cs index 2d6e782c28..5731ddf098 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Controllers/AtomicConstrainedOperationsControllerTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Controllers/AtomicConstrainedOperationsControllerTests.cs @@ -4,20 +4,19 @@ using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; using JsonApiDotNetCoreExample.Controllers; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using TestBuildingBlocks; using Xunit; namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Controllers { - public sealed class AtomicConstrainedOperationsControllerTests - : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicConstrainedOperationsControllerTests : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicConstrainedOperationsControllerTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) + public AtomicConstrainedOperationsControllerTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceTests.cs index def31fd094..1c49d829c7 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceTests.cs @@ -8,7 +8,6 @@ using FluentAssertions.Extensions; using JsonApiDotNetCore.Serialization.Objects; using JsonApiDotNetCoreExample.Controllers; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -21,7 +20,8 @@ public sealed class AtomicCreateResourceTests : IntegrationTestFixture, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicCreateResourceTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) + public AtomicCreateResourceTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithClientGeneratedIdTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithClientGeneratedIdTests.cs index 4936b9ada4..194d1ad8b0 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithClientGeneratedIdTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithClientGeneratedIdTests.cs @@ -6,7 +6,6 @@ using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; using JsonApiDotNetCoreExample.Controllers; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -14,14 +13,14 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Creating { - public sealed class AtomicCreateResourceWithClientGeneratedIdTests - : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicCreateResourceWithClientGeneratedIdTests : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); public AtomicCreateResourceWithClientGeneratedIdTests( - ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) + ExampleIntegrationTestContext, OperationsDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToManyRelationshipTests.cs index 26bf9bde4b..4f52eb56ca 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToManyRelationshipTests.cs @@ -6,7 +6,6 @@ using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; using JsonApiDotNetCoreExample.Controllers; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -14,14 +13,14 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Creating { - public sealed class AtomicCreateResourceWithToManyRelationshipTests - : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicCreateResourceWithToManyRelationshipTests : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); public AtomicCreateResourceWithToManyRelationshipTests( - ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) + ExampleIntegrationTestContext, OperationsDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToOneRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToOneRelationshipTests.cs index 22a3c676e0..08fd6a9dbb 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToOneRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToOneRelationshipTests.cs @@ -7,7 +7,6 @@ using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; using JsonApiDotNetCoreExample.Controllers; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using Newtonsoft.Json; @@ -16,14 +15,14 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Creating { - public sealed class AtomicCreateResourceWithToOneRelationshipTests - : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicCreateResourceWithToOneRelationshipTests : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); public AtomicCreateResourceWithToOneRelationshipTests( - ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) + ExampleIntegrationTestContext, OperationsDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Deleting/AtomicDeleteResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Deleting/AtomicDeleteResourceTests.cs index 7c40439890..f597a26b31 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Deleting/AtomicDeleteResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Deleting/AtomicDeleteResourceTests.cs @@ -7,7 +7,6 @@ using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; using JsonApiDotNetCoreExample.Controllers; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -20,7 +19,8 @@ public sealed class AtomicDeleteResourceTests : IntegrationTestFixture, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicDeleteResourceTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) + public AtomicDeleteResourceTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicAbsoluteLinksTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicAbsoluteLinksTests.cs index e3e0b90982..75a538c9ad 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicAbsoluteLinksTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicAbsoluteLinksTests.cs @@ -5,7 +5,6 @@ using JsonApiDotNetCore.Resources; using JsonApiDotNetCore.Serialization.Objects; using JsonApiDotNetCoreExample.Controllers; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -20,7 +19,8 @@ public sealed class AtomicAbsoluteLinksTests : IntegrationTestFixture, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicAbsoluteLinksTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) + public AtomicAbsoluteLinksTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicRelativeLinksWithNamespaceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicRelativeLinksWithNamespaceTests.cs index fc647250e7..0dc03aa32f 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicRelativeLinksWithNamespaceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicRelativeLinksWithNamespaceTests.cs @@ -6,7 +6,6 @@ using JsonApiDotNetCore.Resources; using JsonApiDotNetCore.Serialization.Objects; using JsonApiDotNetCoreExample.Controllers; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -20,7 +19,8 @@ public sealed class AtomicRelativeLinksWithNamespaceTests private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; public AtomicRelativeLinksWithNamespaceTests( - ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) + ExampleIntegrationTestContext, OperationsDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/LocalIds/AtomicLocalIdTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/LocalIds/AtomicLocalIdTests.cs index 1abe63708d..31aae2b93e 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/LocalIds/AtomicLocalIdTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/LocalIds/AtomicLocalIdTests.cs @@ -6,7 +6,6 @@ using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; using JsonApiDotNetCoreExample.Controllers; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -19,7 +18,8 @@ public sealed class AtomicLocalIdTests : IntegrationTestFixture, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicLocalIdTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) + public AtomicLocalIdTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResourceMetaTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResourceMetaTests.cs index 9a055762d8..ebdfa687db 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResourceMetaTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResourceMetaTests.cs @@ -7,7 +7,6 @@ using JsonApiDotNetCore.Resources; using JsonApiDotNetCore.Serialization.Objects; using JsonApiDotNetCoreExample.Controllers; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -20,7 +19,8 @@ public sealed class AtomicResourceMetaTests : IntegrationTestFixture, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicResourceMetaTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) + public AtomicResourceMetaTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResponseMetaTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResponseMetaTests.cs index 1ad52a979d..95ae92ceb1 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResponseMetaTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResponseMetaTests.cs @@ -7,7 +7,6 @@ using JsonApiDotNetCore.Serialization; using JsonApiDotNetCore.Serialization.Objects; using JsonApiDotNetCoreExample.Controllers; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using Newtonsoft.Json.Linq; @@ -21,7 +20,8 @@ public sealed class AtomicResponseMetaTests : IntegrationTestFixture, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicResponseMetaTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) + public AtomicResponseMetaTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/AtomicRequestBodyTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/AtomicRequestBodyTests.cs index 76f6e16237..4d7b8f90e4 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/AtomicRequestBodyTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/AtomicRequestBodyTests.cs @@ -5,7 +5,6 @@ using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; using JsonApiDotNetCoreExample.Controllers; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -17,7 +16,8 @@ public sealed class AtomicRequestBodyTests : IntegrationTestFixture, OperationsDbContext> _testContext; - public AtomicRequestBodyTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) + public AtomicRequestBodyTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/MaximumOperationsPerRequestTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/MaximumOperationsPerRequestTests.cs index 10207f8b75..39ab2c1635 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/MaximumOperationsPerRequestTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/MaximumOperationsPerRequestTests.cs @@ -6,7 +6,6 @@ using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; using JsonApiDotNetCoreExample.Controllers; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -14,12 +13,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Mixed { - public sealed class MaximumOperationsPerRequestTests - : IntegrationTestFixture, OperationsDbContext> + public sealed class MaximumOperationsPerRequestTests : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; - public MaximumOperationsPerRequestTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) + public MaximumOperationsPerRequestTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ModelStateValidation/AtomicModelStateValidationTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ModelStateValidation/AtomicModelStateValidationTests.cs index 9ef7954076..f51ffb3412 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ModelStateValidation/AtomicModelStateValidationTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ModelStateValidation/AtomicModelStateValidationTests.cs @@ -4,7 +4,6 @@ using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; using JsonApiDotNetCoreExample.Controllers; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -12,13 +11,13 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.ModelStateValidation { - public sealed class AtomicModelStateValidationTests - : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicModelStateValidationTests : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicModelStateValidationTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) + public AtomicModelStateValidationTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/QueryStrings/AtomicQueryStringTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/QueryStrings/AtomicQueryStringTests.cs index 39c8d39d77..1c050ef91d 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/QueryStrings/AtomicQueryStringTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/QueryStrings/AtomicQueryStringTests.cs @@ -9,7 +9,6 @@ using JsonApiDotNetCore.Resources; using JsonApiDotNetCore.Serialization.Objects; using JsonApiDotNetCoreExample.Controllers; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.AspNetCore.Authentication; using Microsoft.Extensions.DependencyInjection; @@ -25,7 +24,8 @@ public sealed class AtomicQueryStringTests : IntegrationTestFixture, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicQueryStringTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) + public AtomicQueryStringTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ResourceDefinitions/AtomicSparseFieldSetResourceDefinitionTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ResourceDefinitions/AtomicSparseFieldSetResourceDefinitionTests.cs index 3df84650cf..ebf5ce2424 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ResourceDefinitions/AtomicSparseFieldSetResourceDefinitionTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ResourceDefinitions/AtomicSparseFieldSetResourceDefinitionTests.cs @@ -6,7 +6,6 @@ using JsonApiDotNetCore.Resources; using JsonApiDotNetCore.Serialization.Objects; using JsonApiDotNetCoreExample.Controllers; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -14,13 +13,13 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.ResourceDefinitions { - public sealed class AtomicSparseFieldSetResourceDefinitionTests - : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicSparseFieldSetResourceDefinitionTests : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicSparseFieldSetResourceDefinitionTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) + public AtomicSparseFieldSetResourceDefinitionTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicRollbackTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicRollbackTests.cs index ced90a34c7..9a5ce48263 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicRollbackTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicRollbackTests.cs @@ -6,7 +6,6 @@ using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; using JsonApiDotNetCoreExample.Controllers; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -19,7 +18,8 @@ public sealed class AtomicRollbackTests : IntegrationTestFixture, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicRollbackTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) + public AtomicRollbackTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicTransactionConsistencyTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicTransactionConsistencyTests.cs index 9c644fb1b8..882fb6af2e 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicTransactionConsistencyTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicTransactionConsistencyTests.cs @@ -6,7 +6,6 @@ using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; using JsonApiDotNetCoreExample.Controllers; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; @@ -15,12 +14,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Transactions { - public sealed class AtomicTransactionConsistencyTests - : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicTransactionConsistencyTests : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; - public AtomicTransactionConsistencyTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) + public AtomicTransactionConsistencyTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicAddToToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicAddToToManyRelationshipTests.cs index b45c4cbcf8..9692de8205 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicAddToToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicAddToToManyRelationshipTests.cs @@ -7,7 +7,6 @@ using JsonApiDotNetCore; using JsonApiDotNetCore.Serialization.Objects; using JsonApiDotNetCoreExample.Controllers; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -15,13 +14,13 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Updating.Relationships { - public sealed class AtomicAddToToManyRelationshipTests - : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicAddToToManyRelationshipTests : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicAddToToManyRelationshipTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) + public AtomicAddToToManyRelationshipTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicRemoveFromToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicRemoveFromToManyRelationshipTests.cs index 6ead9753c7..e05d6ef95c 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicRemoveFromToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicRemoveFromToManyRelationshipTests.cs @@ -7,7 +7,6 @@ using JsonApiDotNetCore; using JsonApiDotNetCore.Serialization.Objects; using JsonApiDotNetCoreExample.Controllers; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -15,13 +14,13 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Updating.Relationships { - public sealed class AtomicRemoveFromToManyRelationshipTests - : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicRemoveFromToManyRelationshipTests : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicRemoveFromToManyRelationshipTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) + public AtomicRemoveFromToManyRelationshipTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicReplaceToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicReplaceToManyRelationshipTests.cs index 7e40531998..6c093d0bbc 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicReplaceToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicReplaceToManyRelationshipTests.cs @@ -7,7 +7,6 @@ using JsonApiDotNetCore; using JsonApiDotNetCore.Serialization.Objects; using JsonApiDotNetCoreExample.Controllers; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -15,13 +14,13 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Updating.Relationships { - public sealed class AtomicReplaceToManyRelationshipTests - : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicReplaceToManyRelationshipTests : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicReplaceToManyRelationshipTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) + public AtomicReplaceToManyRelationshipTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicUpdateToOneRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicUpdateToOneRelationshipTests.cs index 05d293ac82..cdb1f5581c 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicUpdateToOneRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicUpdateToOneRelationshipTests.cs @@ -6,7 +6,6 @@ using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; using JsonApiDotNetCoreExample.Controllers; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -14,13 +13,13 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Updating.Relationships { - public sealed class AtomicUpdateToOneRelationshipTests - : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicUpdateToOneRelationshipTests : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicUpdateToOneRelationshipTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) + public AtomicUpdateToOneRelationshipTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicReplaceToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicReplaceToManyRelationshipTests.cs index fc2e5db999..515c3b167b 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicReplaceToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicReplaceToManyRelationshipTests.cs @@ -7,7 +7,6 @@ using JsonApiDotNetCore; using JsonApiDotNetCore.Serialization.Objects; using JsonApiDotNetCoreExample.Controllers; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -15,13 +14,13 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Updating.Resources { - public sealed class AtomicReplaceToManyRelationshipTests - : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicReplaceToManyRelationshipTests : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicReplaceToManyRelationshipTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) + public AtomicReplaceToManyRelationshipTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateResourceTests.cs index 4af52e4e2a..1e8e4b8cbd 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateResourceTests.cs @@ -8,7 +8,6 @@ using FluentAssertions.Extensions; using JsonApiDotNetCore.Serialization.Objects; using JsonApiDotNetCoreExample.Controllers; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -21,7 +20,8 @@ public sealed class AtomicUpdateResourceTests : IntegrationTestFixture, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicUpdateResourceTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) + public AtomicUpdateResourceTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateToOneRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateToOneRelationshipTests.cs index 3dc345115f..8ebbf953c3 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateToOneRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateToOneRelationshipTests.cs @@ -6,7 +6,6 @@ using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; using JsonApiDotNetCoreExample.Controllers; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -14,13 +13,13 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Updating.Resources { - public sealed class AtomicUpdateToOneRelationshipTests - : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicUpdateToOneRelationshipTests : IntegrationTestFixture, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); - public AtomicUpdateToOneRelationshipTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) : base(testContext) + public AtomicUpdateToOneRelationshipTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CompositeKeys/CompositeKeyTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CompositeKeys/CompositeKeyTests.cs index 4b94196bda..d723ed92ab 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CompositeKeys/CompositeKeyTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CompositeKeys/CompositeKeyTests.cs @@ -6,7 +6,6 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; @@ -19,7 +18,8 @@ public sealed class CompositeKeyTests : IntegrationTestFixture, CompositeDbContext> _testContext; - public CompositeKeyTests(ExampleIntegrationTestContext, CompositeDbContext> testContext) : base(testContext) + public CompositeKeyTests(ExampleIntegrationTestContext, CompositeDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/AcceptHeaderTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/AcceptHeaderTests.cs index 9d24291191..eb302f8443 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/AcceptHeaderTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/AcceptHeaderTests.cs @@ -16,7 +16,8 @@ public sealed class AcceptHeaderTests : IntegrationTestFixture, PolicyDbContext> _testContext; - public AcceptHeaderTests(ExampleIntegrationTestContext, PolicyDbContext> testContext) : base(testContext) + public AcceptHeaderTests(ExampleIntegrationTestContext, PolicyDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/ContentTypeHeaderTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/ContentTypeHeaderTests.cs index 43746e0d1c..26f21e69f0 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/ContentTypeHeaderTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/ContentTypeHeaderTests.cs @@ -15,7 +15,8 @@ public sealed class ContentTypeHeaderTests : IntegrationTestFixture, PolicyDbContext> _testContext; - public ContentTypeHeaderTests(ExampleIntegrationTestContext, PolicyDbContext> testContext) : base(testContext) + public ContentTypeHeaderTests(ExampleIntegrationTestContext, PolicyDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ControllerActionResults/ActionResultTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ControllerActionResults/ActionResultTests.cs index 1d3e9ca2f7..87ba1f68f0 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ControllerActionResults/ActionResultTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ControllerActionResults/ActionResultTests.cs @@ -3,7 +3,6 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using TestBuildingBlocks; using Xunit; @@ -14,7 +13,8 @@ public sealed class ActionResultTests : IntegrationTestFixture, ActionResultDbContext> _testContext; - public ActionResultTests(ExampleIntegrationTestContext, ActionResultDbContext> testContext) : base(testContext) + public ActionResultTests(ExampleIntegrationTestContext, ActionResultDbContext> testContext) + : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/ApiControllerAttributeTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/ApiControllerAttributeTests.cs index da02861c62..aafe5fc5a6 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/ApiControllerAttributeTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/ApiControllerAttributeTests.cs @@ -3,7 +3,6 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using TestBuildingBlocks; using Xunit; @@ -14,7 +13,8 @@ public sealed class ApiControllerAttributeTests : IntegrationTestFixture, CustomRouteDbContext> _testContext; - public ApiControllerAttributeTests(ExampleIntegrationTestContext, CustomRouteDbContext> testContext) : base(testContext) + public ApiControllerAttributeTests(ExampleIntegrationTestContext, CustomRouteDbContext> testContext) + : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/CustomRouteTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/CustomRouteTests.cs index c8acc54b9c..84ad2ee7a6 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/CustomRouteTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/CustomRouteTests.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using TestBuildingBlocks; using Xunit; @@ -19,7 +18,8 @@ public sealed class CustomRouteTests : IntegrationTestFixture, CustomRouteDbContext> _testContext; private readonly CustomRouteFakers _fakers = new CustomRouteFakers(); - public CustomRouteTests(ExampleIntegrationTestContext, CustomRouteDbContext> testContext) : base(testContext) + public CustomRouteTests(ExampleIntegrationTestContext, CustomRouteDbContext> testContext) + : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/EagerLoading/EagerLoadingTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/EagerLoading/EagerLoadingTests.cs index 3e0fbaafb6..6ca6b36004 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/EagerLoading/EagerLoadingTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/EagerLoading/EagerLoadingTests.cs @@ -4,7 +4,6 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -17,7 +16,8 @@ public sealed class EagerLoadingTests : IntegrationTestFixture, EagerLoadingDbContext> _testContext; private readonly EagerLoadingFakers _fakers = new EagerLoadingFakers(); - public EagerLoadingTests(ExampleIntegrationTestContext, EagerLoadingDbContext> testContext) : base(testContext) + public EagerLoadingTests(ExampleIntegrationTestContext, EagerLoadingDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ExceptionHandling/ExceptionHandlerTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ExceptionHandling/ExceptionHandlerTests.cs index 934077b7e4..052b46f031 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ExceptionHandling/ExceptionHandlerTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ExceptionHandling/ExceptionHandlerTests.cs @@ -7,7 +7,6 @@ using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Middleware; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; @@ -21,7 +20,8 @@ public sealed class ExceptionHandlerTests : IntegrationTestFixture, ErrorDbContext> _testContext; - public ExceptionHandlerTests(ExampleIntegrationTestContext, ErrorDbContext> testContext) : base(testContext) + public ExceptionHandlerTests(ExampleIntegrationTestContext, ErrorDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/HostingInIIS/HostingTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/HostingInIIS/HostingTests.cs index 784adabf24..46037e3a7c 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/HostingInIIS/HostingTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/HostingInIIS/HostingTests.cs @@ -4,7 +4,6 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using TestBuildingBlocks; using Xunit; @@ -17,7 +16,8 @@ public sealed class HostingTests : IntegrationTestFixture, HostingDbContext> _testContext; private readonly HostingFakers _fakers = new HostingFakers(); - public HostingTests(ExampleIntegrationTestContext, HostingDbContext> testContext) : base(testContext) + public HostingTests(ExampleIntegrationTestContext, HostingDbContext> testContext) + : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/IdObfuscation/IdObfuscationTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/IdObfuscation/IdObfuscationTests.cs index 6440eb7131..3cf3102138 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/IdObfuscation/IdObfuscationTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/IdObfuscation/IdObfuscationTests.cs @@ -4,7 +4,6 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -17,7 +16,8 @@ public sealed class IdObfuscationTests : IntegrationTestFixture, ObfuscationDbContext> _testContext; private readonly ObfuscationFakers _fakers = new ObfuscationFakers(); - public IdObfuscationTests(ExampleIntegrationTestContext, ObfuscationDbContext> testContext) : base(testContext) + public IdObfuscationTests(ExampleIntegrationTestContext, ObfuscationDbContext> testContext) + : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithNamespaceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithNamespaceTests.cs index 0ca0eaa4e3..4c9634ca1e 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithNamespaceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithNamespaceTests.cs @@ -6,7 +6,6 @@ using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Resources; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -14,15 +13,15 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Links { - public sealed class AbsoluteLinksWithNamespaceTests - : IntegrationTestFixture, LinksDbContext> + public sealed class AbsoluteLinksWithNamespaceTests : IntegrationTestFixture, LinksDbContext> { private const string HostPrefix = "http://localhost"; private readonly ExampleIntegrationTestContext, LinksDbContext> _testContext; private readonly LinksFakers _fakers = new LinksFakers(); - public AbsoluteLinksWithNamespaceTests(ExampleIntegrationTestContext, LinksDbContext> testContext) : base(testContext) + public AbsoluteLinksWithNamespaceTests(ExampleIntegrationTestContext, LinksDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithoutNamespaceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithoutNamespaceTests.cs index 8648a2544f..30a773d33a 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithoutNamespaceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithoutNamespaceTests.cs @@ -6,7 +6,6 @@ using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Resources; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -14,15 +13,15 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Links { - public sealed class AbsoluteLinksWithoutNamespaceTests - : IntegrationTestFixture, LinksDbContext> + public sealed class AbsoluteLinksWithoutNamespaceTests : IntegrationTestFixture, LinksDbContext> { private const string HostPrefix = "http://localhost"; private readonly ExampleIntegrationTestContext, LinksDbContext> _testContext; private readonly LinksFakers _fakers = new LinksFakers(); - public AbsoluteLinksWithoutNamespaceTests(ExampleIntegrationTestContext, LinksDbContext> testContext) : base(testContext) + public AbsoluteLinksWithoutNamespaceTests(ExampleIntegrationTestContext, LinksDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/LinkInclusionTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/LinkInclusionTests.cs index 23435a0f8c..e2fddfe1e4 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/LinkInclusionTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/LinkInclusionTests.cs @@ -3,7 +3,6 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using TestBuildingBlocks; using Xunit; @@ -15,7 +14,8 @@ public sealed class LinkInclusionTests : IntegrationTestFixture, LinksDbContext> _testContext; private readonly LinksFakers _fakers = new LinksFakers(); - public LinkInclusionTests(ExampleIntegrationTestContext, LinksDbContext> testContext) : base(testContext) + public LinkInclusionTests(ExampleIntegrationTestContext, LinksDbContext> testContext) + : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithNamespaceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithNamespaceTests.cs index 31f92a3d04..3ea5ea51d7 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithNamespaceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithNamespaceTests.cs @@ -6,7 +6,6 @@ using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Resources; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -14,13 +13,13 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Links { - public sealed class RelativeLinksWithNamespaceTests - : IntegrationTestFixture, LinksDbContext> + public sealed class RelativeLinksWithNamespaceTests : IntegrationTestFixture, LinksDbContext> { private readonly ExampleIntegrationTestContext, LinksDbContext> _testContext; private readonly LinksFakers _fakers = new LinksFakers(); - public RelativeLinksWithNamespaceTests(ExampleIntegrationTestContext, LinksDbContext> testContext) : base(testContext) + public RelativeLinksWithNamespaceTests(ExampleIntegrationTestContext, LinksDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithoutNamespaceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithoutNamespaceTests.cs index ef7c3e0762..4e95b9ac26 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithoutNamespaceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithoutNamespaceTests.cs @@ -6,7 +6,6 @@ using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Resources; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -14,13 +13,13 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Links { - public sealed class RelativeLinksWithoutNamespaceTests - : IntegrationTestFixture, LinksDbContext> + public sealed class RelativeLinksWithoutNamespaceTests : IntegrationTestFixture, LinksDbContext> { private readonly ExampleIntegrationTestContext, LinksDbContext> _testContext; private readonly LinksFakers _fakers = new LinksFakers(); - public RelativeLinksWithoutNamespaceTests(ExampleIntegrationTestContext, LinksDbContext> testContext) : base(testContext) + public RelativeLinksWithoutNamespaceTests(ExampleIntegrationTestContext, LinksDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Logging/LoggingTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Logging/LoggingTests.cs index fc65fda2cb..4d6a9a40f7 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Logging/LoggingTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Logging/LoggingTests.cs @@ -3,7 +3,6 @@ using System.Net.Http; using System.Threading.Tasks; using FluentAssertions; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; @@ -17,7 +16,8 @@ public sealed class LoggingTests : IntegrationTestFixture, AuditDbContext> _testContext; private readonly AuditFakers _fakers = new AuditFakers(); - public LoggingTests(ExampleIntegrationTestContext, AuditDbContext> testContext) : base(testContext) + public LoggingTests(ExampleIntegrationTestContext, AuditDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResourceMetaTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResourceMetaTests.cs index 0943637ec5..d1c0628752 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResourceMetaTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResourceMetaTests.cs @@ -5,7 +5,6 @@ using FluentAssertions; using JsonApiDotNetCore.Resources; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -18,7 +17,8 @@ public sealed class ResourceMetaTests : IntegrationTestFixture, SupportDbContext> _testContext; private readonly SupportFakers _fakers = new SupportFakers(); - public ResourceMetaTests(ExampleIntegrationTestContext, SupportDbContext> testContext) : base(testContext) + public ResourceMetaTests(ExampleIntegrationTestContext, SupportDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResponseMetaTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResponseMetaTests.cs index dbff15144f..92e2b305e7 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResponseMetaTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResponseMetaTests.cs @@ -4,7 +4,6 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -16,7 +15,8 @@ public sealed class ResponseMetaTests : IntegrationTestFixture, SupportDbContext> _testContext; - public ResponseMetaTests(ExampleIntegrationTestContext, SupportDbContext> testContext) : base(testContext) + public ResponseMetaTests(ExampleIntegrationTestContext, SupportDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/TopLevelCountTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/TopLevelCountTests.cs index eb67abaa2f..6087e61ef9 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/TopLevelCountTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/TopLevelCountTests.cs @@ -5,7 +5,6 @@ using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Resources; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -18,7 +17,8 @@ public sealed class TopLevelCountTests : IntegrationTestFixture, SupportDbContext> _testContext; private readonly SupportFakers _fakers = new SupportFakers(); - public TopLevelCountTests(ExampleIntegrationTestContext, SupportDbContext> testContext) : base(testContext) + public TopLevelCountTests(ExampleIntegrationTestContext, SupportDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/ModelStateValidationTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/ModelStateValidationTests.cs index e1f994be8c..3fc1a6a01d 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/ModelStateValidationTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/ModelStateValidationTests.cs @@ -4,19 +4,18 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using TestBuildingBlocks; using Xunit; namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ModelStateValidation { - public sealed class ModelStateValidationTests - : IntegrationTestFixture, ModelStateDbContext> + public sealed class ModelStateValidationTests : IntegrationTestFixture, ModelStateDbContext> { private readonly ExampleIntegrationTestContext, ModelStateDbContext> _testContext; - public ModelStateValidationTests(ExampleIntegrationTestContext, ModelStateDbContext> testContext) : base(testContext) + public ModelStateValidationTests(ExampleIntegrationTestContext, ModelStateDbContext> testContext) + : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/NoModelStateValidationTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/NoModelStateValidationTests.cs index d67ff05626..dff9ffb7ec 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/NoModelStateValidationTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/NoModelStateValidationTests.cs @@ -3,7 +3,6 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using TestBuildingBlocks; using Xunit; @@ -14,7 +13,8 @@ public sealed class NoModelStateValidationTests : IntegrationTestFixture, ModelStateDbContext> _testContext; - public NoModelStateValidationTests(ExampleIntegrationTestContext, ModelStateDbContext> testContext) : base(testContext) + public NoModelStateValidationTests(ExampleIntegrationTestContext, ModelStateDbContext> testContext) + : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NamingConventions/KebabCasingTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NamingConventions/KebabCasingTests.cs index 8521b11150..3ac051b83a 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NamingConventions/KebabCasingTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NamingConventions/KebabCasingTests.cs @@ -4,7 +4,6 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using TestBuildingBlocks; using Xunit; @@ -15,7 +14,8 @@ public sealed class KebabCasingTests : IntegrationTestFixture, SwimmingDbContext> _testContext; private readonly SwimmingFakers _fakers = new SwimmingFakers(); - public KebabCasingTests(ExampleIntegrationTestContext, SwimmingDbContext> testContext) : base(testContext) + public KebabCasingTests(ExampleIntegrationTestContext, SwimmingDbContext> testContext) + : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NonJsonApiControllers/NonJsonApiControllerTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NonJsonApiControllers/NonJsonApiControllerTests.cs index 3d4a535ae9..8377ffadef 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NonJsonApiControllers/NonJsonApiControllerTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NonJsonApiControllers/NonJsonApiControllerTests.cs @@ -3,10 +3,7 @@ using System.Net.Http.Headers; using System.Threading.Tasks; using FluentAssertions; -using JsonApiDotNetCoreExample.Controllers; using JsonApiDotNetCoreExample.Startups; -using Microsoft.AspNetCore.Mvc.Testing; -using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; using Xunit; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDataTypeTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDataTypeTests.cs index 676e0cc4e9..e38b7d47b2 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDataTypeTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDataTypeTests.cs @@ -9,7 +9,6 @@ using Humanizer; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -21,7 +20,8 @@ public sealed class FilterDataTypeTests : IntegrationTestFixture, FilterDbContext> _testContext; - public FilterDataTypeTests(ExampleIntegrationTestContext, FilterDbContext> testContext) : base(testContext) + public FilterDataTypeTests(ExampleIntegrationTestContext, FilterDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDepthTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDepthTests.cs index 63d5a09330..d1b43546ee 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDepthTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDepthTests.cs @@ -7,7 +7,6 @@ using FluentAssertions.Extensions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -20,7 +19,8 @@ public sealed class FilterDepthTests : IntegrationTestFixture, QueryStringDbContext> _testContext; private readonly QueryStringFakers _fakers = new QueryStringFakers(); - public FilterDepthTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) : base(testContext) + public FilterDepthTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterOperatorTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterOperatorTests.cs index bc9ea0b14c..14a10cc854 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterOperatorTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterOperatorTests.cs @@ -9,7 +9,6 @@ using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Queries.Expressions; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -21,7 +20,8 @@ public sealed class FilterOperatorTests : IntegrationTestFixture, FilterDbContext> _testContext; - public FilterOperatorTests(ExampleIntegrationTestContext, FilterDbContext> testContext) : base(testContext) + public FilterOperatorTests(ExampleIntegrationTestContext, FilterDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterTests.cs index b10d763c0d..a2c0423e45 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterTests.cs @@ -5,7 +5,6 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -18,7 +17,8 @@ public sealed class FilterTests : IntegrationTestFixture, QueryStringDbContext> _testContext; private readonly QueryStringFakers _fakers = new QueryStringFakers(); - public FilterTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) : base(testContext) + public FilterTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Includes/IncludeTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Includes/IncludeTests.cs index eeb5cec128..4dffaebb2a 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Includes/IncludeTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Includes/IncludeTests.cs @@ -6,7 +6,6 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -19,7 +18,8 @@ public sealed class IncludeTests : IntegrationTestFixture, QueryStringDbContext> _testContext; private readonly QueryStringFakers _fakers = new QueryStringFakers(); - public IncludeTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) : base(testContext) + public IncludeTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithTotalCountTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithTotalCountTests.cs index 418069e7d6..2fecf283aa 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithTotalCountTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithTotalCountTests.cs @@ -6,7 +6,6 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -14,8 +13,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.Pagination { - public sealed class PaginationWithTotalCountTests - : IntegrationTestFixture, QueryStringDbContext> + public sealed class PaginationWithTotalCountTests : IntegrationTestFixture, QueryStringDbContext> { private const string HostPrefix = "http://localhost"; private const int DefaultPageSize = 5; @@ -23,7 +21,8 @@ public sealed class PaginationWithTotalCountTests private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; private readonly QueryStringFakers _fakers = new QueryStringFakers(); - public PaginationWithTotalCountTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) : base(testContext) + public PaginationWithTotalCountTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithoutTotalCountTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithoutTotalCountTests.cs index 88011068dc..b3795abde9 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithoutTotalCountTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithoutTotalCountTests.cs @@ -5,7 +5,6 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -13,8 +12,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.Pagination { - public sealed class PaginationWithoutTotalCountTests - : IntegrationTestFixture, QueryStringDbContext> + public sealed class PaginationWithoutTotalCountTests : IntegrationTestFixture, QueryStringDbContext> { private const string HostPrefix = "http://localhost"; private const int DefaultPageSize = 5; @@ -22,7 +20,8 @@ public sealed class PaginationWithoutTotalCountTests private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; private readonly QueryStringFakers _fakers = new QueryStringFakers(); - public PaginationWithoutTotalCountTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) : base(testContext) + public PaginationWithoutTotalCountTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationTests.cs index 446b50d5b6..8233a36c11 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationTests.cs @@ -5,7 +5,6 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -19,7 +18,8 @@ public sealed class RangeValidationTests : IntegrationTestFixture, QueryStringDbContext> _testContext; private readonly QueryStringFakers _fakers = new QueryStringFakers(); - public RangeValidationTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) : base(testContext) + public RangeValidationTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationWithMaximumTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationWithMaximumTests.cs index 1e6f2121eb..5ee8d0fd48 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationWithMaximumTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationWithMaximumTests.cs @@ -4,7 +4,6 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -12,14 +11,14 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.Pagination { - public sealed class RangeValidationWithMaximumTests - : IntegrationTestFixture, QueryStringDbContext> + public sealed class RangeValidationWithMaximumTests : IntegrationTestFixture, QueryStringDbContext> { private const int MaximumPageSize = 15; private const int MaximumPageNumber = 20; private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; - public RangeValidationWithMaximumTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) : base(testContext) + public RangeValidationWithMaximumTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/QueryStringTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/QueryStringTests.cs index d659ff5b60..170e44d69b 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/QueryStringTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/QueryStringTests.cs @@ -4,7 +4,6 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -16,7 +15,8 @@ public sealed class QueryStringTests : IntegrationTestFixture, QueryStringDbContext> _testContext; - public QueryStringTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) : base(testContext) + public QueryStringTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) + : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerDefaultValueHandlingTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerDefaultValueHandlingTests.cs index 1b33bfc735..1aa1efef0a 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerDefaultValueHandlingTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerDefaultValueHandlingTests.cs @@ -5,7 +5,6 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using Newtonsoft.Json; @@ -14,13 +13,13 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings { - public sealed class SerializerDefaultValueHandlingTests - : IntegrationTestFixture, QueryStringDbContext> + public sealed class SerializerDefaultValueHandlingTests : IntegrationTestFixture, QueryStringDbContext> { private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; private readonly QueryStringFakers _fakers = new QueryStringFakers(); - public SerializerDefaultValueHandlingTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) : base(testContext) + public SerializerDefaultValueHandlingTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) + : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerNullValueHandlingTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerNullValueHandlingTests.cs index dff0c49e6d..6a504c4c8c 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerNullValueHandlingTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerNullValueHandlingTests.cs @@ -5,7 +5,6 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using Newtonsoft.Json; @@ -14,13 +13,13 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings { - public sealed class SerializerNullValueHandlingTests - : IntegrationTestFixture, QueryStringDbContext> + public sealed class SerializerNullValueHandlingTests : IntegrationTestFixture, QueryStringDbContext> { private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; private readonly QueryStringFakers _fakers = new QueryStringFakers(); - public SerializerNullValueHandlingTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) : base(testContext) + public SerializerNullValueHandlingTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) + : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Sorting/SortTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Sorting/SortTests.cs index eee1d824d4..df5966a254 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Sorting/SortTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Sorting/SortTests.cs @@ -6,7 +6,6 @@ using FluentAssertions; using FluentAssertions.Extensions; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using TestBuildingBlocks; using Xunit; @@ -18,7 +17,8 @@ public sealed class SortTests : IntegrationTestFixture, QueryStringDbContext> _testContext; private readonly QueryStringFakers _fakers = new QueryStringFakers(); - public SortTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) : base(testContext) + public SortTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) + : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SparseFieldSets/SparseFieldSetTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SparseFieldSets/SparseFieldSetTests.cs index 112150c968..84f8fa9daa 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SparseFieldSets/SparseFieldSetTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SparseFieldSets/SparseFieldSetTests.cs @@ -6,7 +6,6 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -19,7 +18,8 @@ public sealed class SparseFieldSetTests : IntegrationTestFixture, QueryStringDbContext> _testContext; private readonly QueryStringFakers _fakers = new QueryStringFakers(); - public SparseFieldSetTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) : base(testContext) + public SparseFieldSetTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceTests.cs index 44d1ab61bf..50a73cf622 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceTests.cs @@ -9,7 +9,6 @@ using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Resources; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; @@ -23,7 +22,8 @@ public sealed class CreateResourceTests : IntegrationTestFixture, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); - public CreateResourceTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) : base(testContext) + public CreateResourceTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithClientGeneratedIdTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithClientGeneratedIdTests.cs index 5ee390eeb3..f364d83b93 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithClientGeneratedIdTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithClientGeneratedIdTests.cs @@ -7,7 +7,6 @@ using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Resources; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -15,13 +14,13 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Creating { - public sealed class CreateResourceWithClientGeneratedIdTests - : IntegrationTestFixture, ReadWriteDbContext> + public sealed class CreateResourceWithClientGeneratedIdTests : IntegrationTestFixture, ReadWriteDbContext> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); - public CreateResourceWithClientGeneratedIdTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) : base(testContext) + public CreateResourceWithClientGeneratedIdTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToManyRelationshipTests.cs index b4f8324136..20b2d48dd6 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToManyRelationshipTests.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -13,13 +12,13 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Creating { - public sealed class CreateResourceWithToManyRelationshipTests - : IntegrationTestFixture, ReadWriteDbContext> + public sealed class CreateResourceWithToManyRelationshipTests : IntegrationTestFixture, ReadWriteDbContext> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); - public CreateResourceWithToManyRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) : base(testContext) + public CreateResourceWithToManyRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) + : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToOneRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToOneRelationshipTests.cs index 544ac20eae..8c24fc5e65 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToOneRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToOneRelationshipTests.cs @@ -6,7 +6,6 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; @@ -16,13 +15,13 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Creating { - public sealed class CreateResourceWithToOneRelationshipTests - : IntegrationTestFixture, ReadWriteDbContext> + public sealed class CreateResourceWithToOneRelationshipTests : IntegrationTestFixture, ReadWriteDbContext> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); - public CreateResourceWithToOneRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) : base(testContext) + public CreateResourceWithToOneRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Deleting/DeleteResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Deleting/DeleteResourceTests.cs index 6bdd475a69..4e86be7c59 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Deleting/DeleteResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Deleting/DeleteResourceTests.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -18,7 +17,8 @@ public sealed class DeleteResourceTests : IntegrationTestFixture, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); - public DeleteResourceTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) : base(testContext) + public DeleteResourceTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) + : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchRelationshipTests.cs index b4d1678ec4..2f11edfefa 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchRelationshipTests.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using TestBuildingBlocks; using Xunit; @@ -17,7 +16,8 @@ public sealed class FetchRelationshipTests : IntegrationTestFixture, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); - public FetchRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) : base(testContext) + public FetchRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) + : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchResourceTests.cs index b07bdcedbc..e2ac1b0a0b 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchResourceTests.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using TestBuildingBlocks; using Xunit; @@ -17,7 +16,8 @@ public sealed class FetchResourceTests : IntegrationTestFixture, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); - public FetchResourceTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) : base(testContext) + public FetchResourceTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) + : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/AddToToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/AddToToManyRelationshipTests.cs index b0e250e11a..3ead3160f6 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/AddToToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/AddToToManyRelationshipTests.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -18,7 +17,8 @@ public sealed class AddToToManyRelationshipTests : IntegrationTestFixture, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); - public AddToToManyRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) : base(testContext) + public AddToToManyRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) + : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/RemoveFromToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/RemoveFromToManyRelationshipTests.cs index d527ec07d4..39e07b4b52 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/RemoveFromToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/RemoveFromToManyRelationshipTests.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -13,13 +12,13 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Updating.Relationships { - public sealed class RemoveFromToManyRelationshipTests - : IntegrationTestFixture, ReadWriteDbContext> + public sealed class RemoveFromToManyRelationshipTests : IntegrationTestFixture, ReadWriteDbContext> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); - public RemoveFromToManyRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) : base(testContext) + public RemoveFromToManyRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) + : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/ReplaceToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/ReplaceToManyRelationshipTests.cs index c26f977f40..f041d77753 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/ReplaceToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/ReplaceToManyRelationshipTests.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -18,7 +17,8 @@ public sealed class ReplaceToManyRelationshipTests : IntegrationTestFixture, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); - public ReplaceToManyRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) : base(testContext) + public ReplaceToManyRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) + : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/UpdateToOneRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/UpdateToOneRelationshipTests.cs index 79de2b5009..8a78c98fa4 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/UpdateToOneRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/UpdateToOneRelationshipTests.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -18,7 +17,8 @@ public sealed class UpdateToOneRelationshipTests : IntegrationTestFixture, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); - public UpdateToOneRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) : base(testContext) + public UpdateToOneRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) + : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/ReplaceToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/ReplaceToManyRelationshipTests.cs index c97ab34eb5..5982f7f960 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/ReplaceToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/ReplaceToManyRelationshipTests.cs @@ -6,7 +6,6 @@ using FluentAssertions; using JsonApiDotNetCore; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -19,7 +18,8 @@ public sealed class ReplaceToManyRelationshipTests : IntegrationTestFixture, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); - public ReplaceToManyRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) : base(testContext) + public ReplaceToManyRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) + : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateResourceTests.cs index 6d23dd719d..7002b57652 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateResourceTests.cs @@ -8,7 +8,6 @@ using FluentAssertions; using JsonApiDotNetCore.Resources; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -21,7 +20,8 @@ public sealed class UpdateResourceTests : IntegrationTestFixture, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); - public UpdateResourceTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) : base(testContext) + public UpdateResourceTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) + : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateToOneRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateToOneRelationshipTests.cs index 5ce8fd0567..d613817969 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateToOneRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateToOneRelationshipTests.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using TestBuildingBlocks; @@ -18,7 +17,8 @@ public sealed class UpdateToOneRelationshipTests : IntegrationTestFixture, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); - public UpdateToOneRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) : base(testContext) + public UpdateToOneRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) + : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RequiredRelationships/DefaultBehaviorTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RequiredRelationships/DefaultBehaviorTests.cs index 6cfe003d5f..9a8958cafd 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RequiredRelationships/DefaultBehaviorTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RequiredRelationships/DefaultBehaviorTests.cs @@ -4,7 +4,6 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -18,7 +17,8 @@ public sealed class DefaultBehaviorTests : IntegrationTestFixture, DefaultBehaviorDbContext> testContext) : base(testContext) + public DefaultBehaviorTests(ExampleIntegrationTestContext, DefaultBehaviorDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceConstructorInjection/ResourceInjectionTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceConstructorInjection/ResourceInjectionTests.cs index f16527847f..5997fa5457 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceConstructorInjection/ResourceInjectionTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceConstructorInjection/ResourceInjectionTests.cs @@ -6,7 +6,6 @@ using FluentAssertions.Common; using FluentAssertions.Extensions; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.AspNetCore.Authentication; using Microsoft.EntityFrameworkCore; @@ -21,7 +20,8 @@ public sealed class ResourceInjectionTests : IntegrationTestFixture, InjectionDbContext> _testContext; private readonly InjectionFakers _fakers; - public ResourceInjectionTests(ExampleIntegrationTestContext, InjectionDbContext> testContext) : base(testContext) + public ResourceInjectionTests(ExampleIntegrationTestContext, InjectionDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceDefinitions/ResourceDefinitionQueryCallbackTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceDefinitions/ResourceDefinitionQueryCallbackTests.cs index 5c02319f62..775bd88135 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceDefinitions/ResourceDefinitionQueryCallbackTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceDefinitions/ResourceDefinitionQueryCallbackTests.cs @@ -7,7 +7,6 @@ using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Resources; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -15,12 +14,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ResourceDefinitions { - public sealed class ResourceDefinitionQueryCallbackTests - : IntegrationTestFixture, CallableDbContext> + public sealed class ResourceDefinitionQueryCallbackTests : IntegrationTestFixture, CallableDbContext> { private readonly ExampleIntegrationTestContext, CallableDbContext> _testContext; - public ResourceDefinitionQueryCallbackTests(ExampleIntegrationTestContext, CallableDbContext> testContext) : base(testContext) + public ResourceDefinitionQueryCallbackTests(ExampleIntegrationTestContext, CallableDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceHooks/ResourceHookTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceHooks/ResourceHookTests.cs index a281679d05..db76c2ae8b 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceHooks/ResourceHookTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceHooks/ResourceHookTests.cs @@ -14,8 +14,6 @@ using JsonApiDotNetCoreExample.Data; using JsonApiDotNetCoreExample.Definitions; using JsonApiDotNetCoreExample.Models; -using JsonApiDotNetCoreExample.Startups; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using Microsoft.Extensions.DependencyInjection; using Newtonsoft.Json; using TestBuildingBlocks; @@ -23,7 +21,6 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ResourceHooks { - public sealed class ResourceHookTests : IClassFixture, AppDbContext>> { private readonly ExampleIntegrationTestContext, AppDbContext> _testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceInheritance/InheritanceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceInheritance/InheritanceTests.cs index 94fd57558e..066baa0d15 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceInheritance/InheritanceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceInheritance/InheritanceTests.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.IntegrationTests.ResourceInheritance.Models; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; @@ -18,7 +17,8 @@ public sealed class InheritanceTests : IntegrationTestFixture, InheritanceDbContext> _testContext; - public InheritanceTests(ExampleIntegrationTestContext, InheritanceDbContext> testContext) : base(testContext) + public InheritanceTests(ExampleIntegrationTestContext, InheritanceDbContext> testContext) + : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/DisableQueryStringTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/DisableQueryStringTests.cs index 30236dd6d2..16c674ac95 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/DisableQueryStringTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/DisableQueryStringTests.cs @@ -4,7 +4,6 @@ using FluentAssertions; using JsonApiDotNetCore.QueryStrings; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -16,7 +15,8 @@ public sealed class DisableQueryStringTests : IntegrationTestFixture, RestrictionDbContext> _testContext; - public DisableQueryStringTests(ExampleIntegrationTestContext, RestrictionDbContext> testContext) : base(testContext) + public DisableQueryStringTests(ExampleIntegrationTestContext, RestrictionDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/HttpReadOnlyTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/HttpReadOnlyTests.cs index eb35b8e68b..1bff32f961 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/HttpReadOnlyTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/HttpReadOnlyTests.cs @@ -3,7 +3,6 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using TestBuildingBlocks; using Xunit; @@ -15,7 +14,8 @@ public sealed class HttpReadOnlyTests : IntegrationTestFixture, RestrictionDbContext> _testContext; private readonly RestrictionFakers _fakers = new RestrictionFakers(); - public HttpReadOnlyTests(ExampleIntegrationTestContext, RestrictionDbContext> testContext) : base(testContext) + public HttpReadOnlyTests(ExampleIntegrationTestContext, RestrictionDbContext> testContext) + : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpDeleteTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpDeleteTests.cs index f0f36cf1e1..890bf38f06 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpDeleteTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpDeleteTests.cs @@ -3,7 +3,6 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using TestBuildingBlocks; using Xunit; @@ -15,7 +14,8 @@ public sealed class NoHttpDeleteTests : IntegrationTestFixture, RestrictionDbContext> _testContext; private readonly RestrictionFakers _fakers = new RestrictionFakers(); - public NoHttpDeleteTests(ExampleIntegrationTestContext, RestrictionDbContext> testContext) : base(testContext) + public NoHttpDeleteTests(ExampleIntegrationTestContext, RestrictionDbContext> testContext) + : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPatchTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPatchTests.cs index 509a170bfa..2203033f56 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPatchTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPatchTests.cs @@ -3,7 +3,6 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using TestBuildingBlocks; using Xunit; @@ -15,7 +14,8 @@ public sealed class NoHttpPatchTests : IntegrationTestFixture, RestrictionDbContext> _testContext; private readonly RestrictionFakers _fakers = new RestrictionFakers(); - public NoHttpPatchTests(ExampleIntegrationTestContext, RestrictionDbContext> testContext) : base(testContext) + public NoHttpPatchTests(ExampleIntegrationTestContext, RestrictionDbContext> testContext) + : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPostTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPostTests.cs index 1758e10cc1..6c45b16a03 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPostTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPostTests.cs @@ -3,7 +3,6 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using TestBuildingBlocks; using Xunit; @@ -15,7 +14,8 @@ public sealed class NoHttpPostTests : IntegrationTestFixture, RestrictionDbContext> _testContext; private readonly RestrictionFakers _fakers = new RestrictionFakers(); - public NoHttpPostTests(ExampleIntegrationTestContext, RestrictionDbContext> testContext) : base(testContext) + public NoHttpPostTests(ExampleIntegrationTestContext, RestrictionDbContext> testContext) + : base(testContext) { _testContext = testContext; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Serialization/SerializationTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Serialization/SerializationTests.cs index dc758998d0..795a4e0944 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Serialization/SerializationTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Serialization/SerializationTests.cs @@ -8,7 +8,6 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Resources; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using Newtonsoft.Json; @@ -23,7 +22,8 @@ public sealed class SerializationTests : IntegrationTestFixture, SerializationDbContext> _testContext; private readonly SerializationFakers _fakers = new SerializationFakers(); - public SerializationTests(ExampleIntegrationTestContext, SerializationDbContext> testContext) : base(testContext) + public SerializationTests(ExampleIntegrationTestContext, SerializationDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/SoftDeletion/SoftDeletionTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/SoftDeletion/SoftDeletionTests.cs index 92c6c21dc6..0a47292e31 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/SoftDeletion/SoftDeletionTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/SoftDeletion/SoftDeletionTests.cs @@ -6,7 +6,6 @@ using FluentAssertions; using JsonApiDotNetCore.Resources; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.Extensions.DependencyInjection; using TestBuildingBlocks; @@ -18,7 +17,8 @@ public sealed class SoftDeletionTests : IntegrationTestFixture, SoftDeletionDbContext> _testContext; - public SoftDeletionTests(ExampleIntegrationTestContext, SoftDeletionDbContext> testContext) : base(testContext) + public SoftDeletionTests(ExampleIntegrationTestContext, SoftDeletionDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/EmptyGuidAsKeyTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/EmptyGuidAsKeyTests.cs index 14d2d6eb67..0d359592ae 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/EmptyGuidAsKeyTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/EmptyGuidAsKeyTests.cs @@ -7,7 +7,6 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; @@ -21,7 +20,8 @@ public sealed class EmptyGuidAsKeyTests : IntegrationTestFixture, ZeroKeyDbContext> _testContext; private readonly ZeroKeyFakers _fakers = new ZeroKeyFakers(); - public EmptyGuidAsKeyTests(ExampleIntegrationTestContext, ZeroKeyDbContext> testContext) : base(testContext) + public EmptyGuidAsKeyTests(ExampleIntegrationTestContext, ZeroKeyDbContext> testContext) + : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/ZeroAsKeyTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/ZeroAsKeyTests.cs index ffc15055d9..315272b4de 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/ZeroAsKeyTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/ZeroAsKeyTests.cs @@ -6,7 +6,6 @@ using FluentAssertions; using JsonApiDotNetCore.Configuration; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation; using JsonApiDotNetCoreExampleTests.Startups; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; @@ -20,7 +19,8 @@ public sealed class ZeroAsKeyTests : IntegrationTestFixture, ZeroKeyDbContext> _testContext; private readonly ZeroKeyFakers _fakers = new ZeroKeyFakers(); - public ZeroAsKeyTests(ExampleIntegrationTestContext, ZeroKeyDbContext> testContext) : base(testContext) + public ZeroAsKeyTests(ExampleIntegrationTestContext, ZeroKeyDbContext> testContext) + : base(testContext) { _testContext = testContext; From 0678f55858bdcd62e4d0d10576a33698401c96df Mon Sep 17 00:00:00 2001 From: maurei Date: Wed, 17 Mar 2021 12:03:40 +0100 Subject: [PATCH 08/18] code cleanup --- .../BaseIntegrationTestContext.cs | 13 +++++++------ .../ServiceCollectionExtensions.cs | 7 ++----- test/TestBuildingBlocks/TestControllerProvider.cs | 8 ++++---- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/test/TestBuildingBlocks/BaseIntegrationTestContext.cs b/test/TestBuildingBlocks/BaseIntegrationTestContext.cs index 7ee21f18de..478e766b46 100644 --- a/test/TestBuildingBlocks/BaseIntegrationTestContext.cs +++ b/test/TestBuildingBlocks/BaseIntegrationTestContext.cs @@ -37,19 +37,20 @@ public abstract class BaseIntegrationTestContext Factory => _lazyFactory.Value; - public void AddController() where TController : class + protected BaseIntegrationTestContext() { - _testControllerProvider.AddController(typeof(TController)); + _lazyFactory = new Lazy>(CreateFactory); } - public void AddControllersInNamespaceOf() + public void AddController() + where TController : class { - _testControllerProvider.AddNamespaceEntrypoint(typeof(TNamespaceEntryPoint)); + _testControllerProvider.AddController(typeof(TController)); } - protected BaseIntegrationTestContext() + public void AddControllersInNamespaceOf() { - _lazyFactory = new Lazy>(CreateFactory); + _testControllerProvider.AddNamespaceEntrypoint(typeof(TNamespaceEntryPoint)); } protected override HttpClient CreateClient() diff --git a/test/TestBuildingBlocks/ServiceCollectionExtensions.cs b/test/TestBuildingBlocks/ServiceCollectionExtensions.cs index fc679e27ca..46a2933924 100644 --- a/test/TestBuildingBlocks/ServiceCollectionExtensions.cs +++ b/test/TestBuildingBlocks/ServiceCollectionExtensions.cs @@ -1,9 +1,6 @@ -using System; -using System.Collections.Generic; using System.Linq; using System.Reflection; using JsonApiDotNetCore; -using JsonApiDotNetCore.Services; using Microsoft.AspNetCore.Mvc.ApplicationParts; using Microsoft.AspNetCore.Mvc.Controllers; using Microsoft.Extensions.DependencyInjection; @@ -45,10 +42,10 @@ private static void RemoveControllerFeatureProviders(this IServiceCollection ser }); } - private static void RemoveExistingControllerFeatureProviders(ApplicationPartManager manager) { - IApplicationFeatureProvider[] providers = manager.FeatureProviders.OfType>().ToArray(); + IApplicationFeatureProvider[] providers = manager.FeatureProviders.OfType>() + .ToArray(); foreach (IApplicationFeatureProvider provider in providers) { diff --git a/test/TestBuildingBlocks/TestControllerProvider.cs b/test/TestBuildingBlocks/TestControllerProvider.cs index eb8a2ee3b5..b1da2cc12f 100644 --- a/test/TestBuildingBlocks/TestControllerProvider.cs +++ b/test/TestBuildingBlocks/TestControllerProvider.cs @@ -2,16 +2,15 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; -using Microsoft.AspNetCore.Mvc.ApplicationParts; using Microsoft.AspNetCore.Mvc.Controllers; namespace TestBuildingBlocks { public sealed class TestControllerProvider : ControllerFeatureProvider { - internal readonly ISet ControllerAssemblies = new HashSet(); - private readonly IList _namespaceEntryPoints = new List(); + private readonly IList _namespaceEntryPoints = new List(); private readonly IList _allowedControllerTypes = new List(); + internal readonly ISet ControllerAssemblies = new HashSet(); private string[] _namespaces; public void AddController(Type controller) @@ -35,7 +34,8 @@ protected override bool IsController(TypeInfo typeInfo) _namespaces ??= _namespaceEntryPoints.Select(type => type.Namespace).ToArray(); - return _allowedControllerTypes.Contains(typeInfo) || _namespaces.Any(@namespace => typeInfo.Namespace!.StartsWith(@namespace, StringComparison.Ordinal)); + return _allowedControllerTypes.Contains(typeInfo) || + _namespaces.Any(@namespace => typeInfo.Namespace!.StartsWith(@namespace, StringComparison.Ordinal)); } } } From 2f59ded343baf66cdabbd10203347c86fd82a700 Mon Sep 17 00:00:00 2001 From: maurei Date: Wed, 17 Mar 2021 12:15:09 +0100 Subject: [PATCH 09/18] self review --- src/JsonApiDotNetCore/ArgumentGuard.cs | 6 +++--- .../ExampleIntegrationTestContext.cs | 9 ++++++++- .../IntegrationTestFixture.cs | 2 +- .../ServiceCollectionExtensions.cs | 16 ---------------- .../TestBuildingBlocks/TestControllerProvider.cs | 2 +- 5 files changed, 13 insertions(+), 22 deletions(-) rename test/JsonApiDotNetCoreExampleTests/{IntegrationTests => }/IntegrationTestFixture.cs (89%) diff --git a/src/JsonApiDotNetCore/ArgumentGuard.cs b/src/JsonApiDotNetCore/ArgumentGuard.cs index a5fe18d178..c9f9e2d6a7 100644 --- a/src/JsonApiDotNetCore/ArgumentGuard.cs +++ b/src/JsonApiDotNetCore/ArgumentGuard.cs @@ -11,7 +11,7 @@ internal static class ArgumentGuard { [AssertionMethod] [ContractAnnotation("value: null => halt")] - internal static void NotNull([CanBeNull] [NoEnumeration] T value, [NotNull] [InvokerParameterName] string name) + public static void NotNull([CanBeNull] [NoEnumeration] T value, [NotNull] [InvokerParameterName] string name) where T : class { if (value is null) @@ -22,7 +22,7 @@ internal static void NotNull([CanBeNull] [NoEnumeration] T value, [NotNull] [ [AssertionMethod] [ContractAnnotation("value: null => halt")] - internal static void NotNullNorEmpty([CanBeNull] IEnumerable value, [NotNull] [InvokerParameterName] string name, + public static void NotNullNorEmpty([CanBeNull] IEnumerable value, [NotNull] [InvokerParameterName] string name, [CanBeNull] string collectionName = null) { NotNull(value, name); @@ -35,7 +35,7 @@ internal static void NotNullNorEmpty([CanBeNull] IEnumerable value, [NotNu [AssertionMethod] [ContractAnnotation("value: null => halt")] - internal static void NotNullNorEmpty([CanBeNull] string value, [NotNull] [InvokerParameterName] string name) + public static void NotNullNorEmpty([CanBeNull] string value, [NotNull] [InvokerParameterName] string name) { NotNull(value, name); diff --git a/test/JsonApiDotNetCoreExampleTests/ExampleIntegrationTestContext.cs b/test/JsonApiDotNetCoreExampleTests/ExampleIntegrationTestContext.cs index e0a4a6bfdc..17232f5bca 100644 --- a/test/JsonApiDotNetCoreExampleTests/ExampleIntegrationTestContext.cs +++ b/test/JsonApiDotNetCoreExampleTests/ExampleIntegrationTestContext.cs @@ -21,7 +21,14 @@ public class ExampleIntegrationTestContext : BaseIntegrati { } - public sealed class ExampleIntegrationTestContext : ExampleIntegrationTestContext + /// + /// A test context for tests that reference the JsonApiDotNetCoreExample project when no database is needed. + /// + /// + /// The server Startup class, which can be defined in the test project. + /// + [UsedImplicitly(ImplicitUseKindFlags.InstantiatedNoFixedConstructorSignature)] + public sealed class ExampleIntegrationTestContext : BaseIntegrationTestContext where TStartup : class { } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/IntegrationTestFixture.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTestFixture.cs similarity index 89% rename from test/JsonApiDotNetCoreExampleTests/IntegrationTests/IntegrationTestFixture.cs rename to test/JsonApiDotNetCoreExampleTests/IntegrationTestFixture.cs index 1a93955d0c..6849167705 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/IntegrationTestFixture.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTestFixture.cs @@ -1,7 +1,7 @@ using Microsoft.EntityFrameworkCore; using Xunit; -namespace JsonApiDotNetCoreExampleTests.IntegrationTests +namespace JsonApiDotNetCoreExampleTests { public abstract class IntegrationTestFixture : IClassFixture> where TStartup : class diff --git a/test/TestBuildingBlocks/ServiceCollectionExtensions.cs b/test/TestBuildingBlocks/ServiceCollectionExtensions.cs index 46a2933924..90b1d67aba 100644 --- a/test/TestBuildingBlocks/ServiceCollectionExtensions.cs +++ b/test/TestBuildingBlocks/ServiceCollectionExtensions.cs @@ -26,22 +26,6 @@ public static void UseControllers(this IServiceCollection services, TestControll }); } - private static void RemoveControllerFeatureProviders(this IServiceCollection services) - { - ArgumentGuard.NotNull(services, nameof(services)); - - services.AddMvcCore().ConfigureApplicationPartManager(manager => - { - IApplicationFeatureProvider[] providers = manager.FeatureProviders.OfType>() - .ToArray(); - - foreach (IApplicationFeatureProvider provider in providers) - { - manager.FeatureProviders.Remove(provider); - } - }); - } - private static void RemoveExistingControllerFeatureProviders(ApplicationPartManager manager) { IApplicationFeatureProvider[] providers = manager.FeatureProviders.OfType>() diff --git a/test/TestBuildingBlocks/TestControllerProvider.cs b/test/TestBuildingBlocks/TestControllerProvider.cs index b1da2cc12f..3d3b293db8 100644 --- a/test/TestBuildingBlocks/TestControllerProvider.cs +++ b/test/TestBuildingBlocks/TestControllerProvider.cs @@ -10,8 +10,8 @@ public sealed class TestControllerProvider : ControllerFeatureProvider { private readonly IList _namespaceEntryPoints = new List(); private readonly IList _allowedControllerTypes = new List(); - internal readonly ISet ControllerAssemblies = new HashSet(); private string[] _namespaces; + internal ISet ControllerAssemblies { get; } = new HashSet(); public void AddController(Type controller) { From 1cb873969716817bc25fb56260b710fcc4ab05a8 Mon Sep 17 00:00:00 2001 From: maurei Date: Wed, 17 Mar 2021 12:31:46 +0100 Subject: [PATCH 10/18] IntegrationTestFixture is not a fixture: rename to ..Collection --- ...IntegrationTestFixture.cs => IntegrationTestCollection.cs} | 4 ++-- .../Controllers/AtomicConstrainedOperationsControllerTests.cs | 2 +- .../AtomicOperations/Creating/AtomicCreateResourceTests.cs | 2 +- .../AtomicCreateResourceWithClientGeneratedIdTests.cs | 2 +- .../AtomicCreateResourceWithToManyRelationshipTests.cs | 2 +- .../AtomicCreateResourceWithToOneRelationshipTests.cs | 2 +- .../AtomicOperations/Deleting/AtomicDeleteResourceTests.cs | 2 +- .../AtomicOperations/Links/AtomicAbsoluteLinksTests.cs | 2 +- .../Links/AtomicRelativeLinksWithNamespaceTests.cs | 2 +- .../AtomicOperations/LocalIds/AtomicLocalIdTests.cs | 2 +- .../AtomicOperations/Meta/AtomicResourceMetaTests.cs | 2 +- .../AtomicOperations/Meta/AtomicResponseMetaTests.cs | 2 +- .../AtomicOperations/Mixed/AtomicRequestBodyTests.cs | 2 +- .../Mixed/MaximumOperationsPerRequestTests.cs | 2 +- .../ModelStateValidation/AtomicModelStateValidationTests.cs | 2 +- .../AtomicOperations/QueryStrings/AtomicQueryStringTests.cs | 2 +- .../AtomicSparseFieldSetResourceDefinitionTests.cs | 2 +- .../AtomicOperations/Transactions/AtomicRollbackTests.cs | 2 +- .../Transactions/AtomicTransactionConsistencyTests.cs | 2 +- .../Relationships/AtomicAddToToManyRelationshipTests.cs | 2 +- .../Relationships/AtomicRemoveFromToManyRelationshipTests.cs | 2 +- .../Relationships/AtomicReplaceToManyRelationshipTests.cs | 2 +- .../Relationships/AtomicUpdateToOneRelationshipTests.cs | 2 +- .../Resources/AtomicReplaceToManyRelationshipTests.cs | 2 +- .../Updating/Resources/AtomicUpdateResourceTests.cs | 2 +- .../Updating/Resources/AtomicUpdateToOneRelationshipTests.cs | 2 +- .../IntegrationTests/CompositeKeys/CompositeKeyTests.cs | 2 +- .../IntegrationTests/ContentNegotiation/AcceptHeaderTests.cs | 2 +- .../ContentNegotiation/ContentTypeHeaderTests.cs | 2 +- .../ControllerActionResults/ActionResultTests.cs | 2 +- .../CustomRoutes/ApiControllerAttributeTests.cs | 2 +- .../IntegrationTests/CustomRoutes/CustomRouteTests.cs | 2 +- .../IntegrationTests/EagerLoading/EagerLoadingTests.cs | 2 +- .../ExceptionHandling/ExceptionHandlerTests.cs | 2 +- .../IntegrationTests/HostingInIIS/HostingTests.cs | 2 +- .../IntegrationTests/IdObfuscation/IdObfuscationTests.cs | 2 +- .../IntegrationTests/Links/AbsoluteLinksWithNamespaceTests.cs | 2 +- .../Links/AbsoluteLinksWithoutNamespaceTests.cs | 2 +- .../IntegrationTests/Links/LinkInclusionTests.cs | 2 +- .../IntegrationTests/Links/RelativeLinksWithNamespaceTests.cs | 2 +- .../Links/RelativeLinksWithoutNamespaceTests.cs | 2 +- .../IntegrationTests/Logging/LoggingTests.cs | 2 +- .../IntegrationTests/Meta/ResourceMetaTests.cs | 2 +- .../IntegrationTests/Meta/ResponseMetaTests.cs | 2 +- .../IntegrationTests/Meta/TopLevelCountTests.cs | 2 +- .../ModelStateValidation/ModelStateValidationTests.cs | 2 +- .../ModelStateValidation/NoModelStateValidationTests.cs | 2 +- .../IntegrationTests/NamingConventions/KebabCasingTests.cs | 2 +- .../QueryStrings/Filtering/FilterDataTypeTests.cs | 2 +- .../QueryStrings/Filtering/FilterDepthTests.cs | 2 +- .../QueryStrings/Filtering/FilterOperatorTests.cs | 2 +- .../IntegrationTests/QueryStrings/Filtering/FilterTests.cs | 2 +- .../IntegrationTests/QueryStrings/Includes/IncludeTests.cs | 2 +- .../QueryStrings/Pagination/PaginationWithTotalCountTests.cs | 2 +- .../Pagination/PaginationWithoutTotalCountTests.cs | 2 +- .../QueryStrings/Pagination/RangeValidationTests.cs | 2 +- .../Pagination/RangeValidationWithMaximumTests.cs | 2 +- .../IntegrationTests/QueryStrings/QueryStringTests.cs | 2 +- .../QueryStrings/SerializerDefaultValueHandlingTests.cs | 2 +- .../QueryStrings/SerializerNullValueHandlingTests.cs | 2 +- .../IntegrationTests/QueryStrings/Sorting/SortTests.cs | 2 +- .../QueryStrings/SparseFieldSets/SparseFieldSetTests.cs | 2 +- .../ReadWrite/Creating/CreateResourceTests.cs | 2 +- .../Creating/CreateResourceWithClientGeneratedIdTests.cs | 2 +- .../Creating/CreateResourceWithToManyRelationshipTests.cs | 2 +- .../Creating/CreateResourceWithToOneRelationshipTests.cs | 2 +- .../ReadWrite/Deleting/DeleteResourceTests.cs | 2 +- .../ReadWrite/Fetching/FetchRelationshipTests.cs | 2 +- .../IntegrationTests/ReadWrite/Fetching/FetchResourceTests.cs | 2 +- .../Updating/Relationships/AddToToManyRelationshipTests.cs | 2 +- .../Relationships/RemoveFromToManyRelationshipTests.cs | 2 +- .../Updating/Relationships/ReplaceToManyRelationshipTests.cs | 2 +- .../Updating/Relationships/UpdateToOneRelationshipTests.cs | 2 +- .../Updating/Resources/ReplaceToManyRelationshipTests.cs | 2 +- .../ReadWrite/Updating/Resources/UpdateResourceTests.cs | 2 +- .../Updating/Resources/UpdateToOneRelationshipTests.cs | 2 +- .../RequiredRelationships/DefaultBehaviorTests.cs | 2 +- .../ResourceConstructorInjection/ResourceInjectionTests.cs | 2 +- .../ResourceDefinitionQueryCallbackTests.cs | 2 +- .../IntegrationTests/ResourceInheritance/InheritanceTests.cs | 2 +- .../RestrictedControllers/DisableQueryStringTests.cs | 2 +- .../RestrictedControllers/HttpReadOnlyTests.cs | 2 +- .../RestrictedControllers/NoHttpDeleteTests.cs | 2 +- .../RestrictedControllers/NoHttpPatchTests.cs | 2 +- .../IntegrationTests/RestrictedControllers/NoHttpPostTests.cs | 2 +- .../IntegrationTests/Serialization/SerializationTests.cs | 2 +- .../IntegrationTests/SoftDeletion/SoftDeletionTests.cs | 2 +- .../IntegrationTests/ZeroKeys/EmptyGuidAsKeyTests.cs | 2 +- .../IntegrationTests/ZeroKeys/ZeroAsKeyTests.cs | 2 +- test/TestBuildingBlocks/ServiceCollectionExtensions.cs | 2 +- test/TestBuildingBlocks/TestControllerProvider.cs | 2 +- 91 files changed, 92 insertions(+), 92 deletions(-) rename test/JsonApiDotNetCoreExampleTests/{IntegrationTestFixture.cs => IntegrationTestCollection.cs} (50%) diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTestFixture.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTestCollection.cs similarity index 50% rename from test/JsonApiDotNetCoreExampleTests/IntegrationTestFixture.cs rename to test/JsonApiDotNetCoreExampleTests/IntegrationTestCollection.cs index 6849167705..6deb8d890d 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTestFixture.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTestCollection.cs @@ -3,11 +3,11 @@ namespace JsonApiDotNetCoreExampleTests { - public abstract class IntegrationTestFixture : IClassFixture> + public abstract class IntegrationTestCollection : IClassFixture> where TStartup : class where TDbContext : DbContext { - protected IntegrationTestFixture(ExampleIntegrationTestContext testContext) + protected IntegrationTestCollection(ExampleIntegrationTestContext testContext) { testContext.AddControllersInNamespaceOf(); } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Controllers/AtomicConstrainedOperationsControllerTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Controllers/AtomicConstrainedOperationsControllerTests.cs index 5731ddf098..4a0e5e577b 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Controllers/AtomicConstrainedOperationsControllerTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Controllers/AtomicConstrainedOperationsControllerTests.cs @@ -10,7 +10,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Controllers { - public sealed class AtomicConstrainedOperationsControllerTests : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicConstrainedOperationsControllerTests : IntegrationTestCollection, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceTests.cs index 1c49d829c7..5dbec1f812 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceTests.cs @@ -15,7 +15,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Creating { - public sealed class AtomicCreateResourceTests : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicCreateResourceTests : IntegrationTestCollection, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithClientGeneratedIdTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithClientGeneratedIdTests.cs index 194d1ad8b0..2f46b95065 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithClientGeneratedIdTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithClientGeneratedIdTests.cs @@ -13,7 +13,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Creating { - public sealed class AtomicCreateResourceWithClientGeneratedIdTests : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicCreateResourceWithClientGeneratedIdTests : IntegrationTestCollection, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToManyRelationshipTests.cs index 4f52eb56ca..7de3a03ecd 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToManyRelationshipTests.cs @@ -13,7 +13,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Creating { - public sealed class AtomicCreateResourceWithToManyRelationshipTests : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicCreateResourceWithToManyRelationshipTests : IntegrationTestCollection, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToOneRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToOneRelationshipTests.cs index 08fd6a9dbb..ff0a6f5fe1 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToOneRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToOneRelationshipTests.cs @@ -15,7 +15,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Creating { - public sealed class AtomicCreateResourceWithToOneRelationshipTests : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicCreateResourceWithToOneRelationshipTests : IntegrationTestCollection, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Deleting/AtomicDeleteResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Deleting/AtomicDeleteResourceTests.cs index f597a26b31..2446039a22 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Deleting/AtomicDeleteResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Deleting/AtomicDeleteResourceTests.cs @@ -14,7 +14,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Deleting { - public sealed class AtomicDeleteResourceTests : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicDeleteResourceTests : IntegrationTestCollection, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicAbsoluteLinksTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicAbsoluteLinksTests.cs index 75a538c9ad..8f9e800192 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicAbsoluteLinksTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicAbsoluteLinksTests.cs @@ -12,7 +12,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Links { - public sealed class AtomicAbsoluteLinksTests : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicAbsoluteLinksTests : IntegrationTestCollection, OperationsDbContext> { private const string HostPrefix = "http://localhost"; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicRelativeLinksWithNamespaceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicRelativeLinksWithNamespaceTests.cs index 0dc03aa32f..866c7cdc0f 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicRelativeLinksWithNamespaceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicRelativeLinksWithNamespaceTests.cs @@ -14,7 +14,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Links { public sealed class AtomicRelativeLinksWithNamespaceTests - : IntegrationTestFixture, OperationsDbContext> + : IntegrationTestCollection, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/LocalIds/AtomicLocalIdTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/LocalIds/AtomicLocalIdTests.cs index 31aae2b93e..97ead8e2fa 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/LocalIds/AtomicLocalIdTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/LocalIds/AtomicLocalIdTests.cs @@ -13,7 +13,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.LocalIds { - public sealed class AtomicLocalIdTests : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicLocalIdTests : IntegrationTestCollection, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResourceMetaTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResourceMetaTests.cs index ebdfa687db..19d2d2123a 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResourceMetaTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResourceMetaTests.cs @@ -14,7 +14,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Meta { - public sealed class AtomicResourceMetaTests : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicResourceMetaTests : IntegrationTestCollection, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResponseMetaTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResponseMetaTests.cs index 95ae92ceb1..7c3d6868fb 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResponseMetaTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResponseMetaTests.cs @@ -15,7 +15,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Meta { - public sealed class AtomicResponseMetaTests : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicResponseMetaTests : IntegrationTestCollection, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/AtomicRequestBodyTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/AtomicRequestBodyTests.cs index 4d7b8f90e4..a4c7cff9ab 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/AtomicRequestBodyTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/AtomicRequestBodyTests.cs @@ -12,7 +12,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Mixed { - public sealed class AtomicRequestBodyTests : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicRequestBodyTests : IntegrationTestCollection, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/MaximumOperationsPerRequestTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/MaximumOperationsPerRequestTests.cs index 39ab2c1635..00768eeefb 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/MaximumOperationsPerRequestTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/MaximumOperationsPerRequestTests.cs @@ -13,7 +13,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Mixed { - public sealed class MaximumOperationsPerRequestTests : IntegrationTestFixture, OperationsDbContext> + public sealed class MaximumOperationsPerRequestTests : IntegrationTestCollection, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ModelStateValidation/AtomicModelStateValidationTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ModelStateValidation/AtomicModelStateValidationTests.cs index f51ffb3412..ac16b2f778 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ModelStateValidation/AtomicModelStateValidationTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ModelStateValidation/AtomicModelStateValidationTests.cs @@ -11,7 +11,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.ModelStateValidation { - public sealed class AtomicModelStateValidationTests : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicModelStateValidationTests : IntegrationTestCollection, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/QueryStrings/AtomicQueryStringTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/QueryStrings/AtomicQueryStringTests.cs index 1c050ef91d..b5f67c8c37 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/QueryStrings/AtomicQueryStringTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/QueryStrings/AtomicQueryStringTests.cs @@ -17,7 +17,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.QueryStrings { - public sealed class AtomicQueryStringTests : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicQueryStringTests : IntegrationTestCollection, OperationsDbContext> { private static readonly DateTime FrozenTime = 30.July(2018).At(13, 46, 12); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ResourceDefinitions/AtomicSparseFieldSetResourceDefinitionTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ResourceDefinitions/AtomicSparseFieldSetResourceDefinitionTests.cs index ebf5ce2424..8b56e3eb03 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ResourceDefinitions/AtomicSparseFieldSetResourceDefinitionTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ResourceDefinitions/AtomicSparseFieldSetResourceDefinitionTests.cs @@ -13,7 +13,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.ResourceDefinitions { - public sealed class AtomicSparseFieldSetResourceDefinitionTests : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicSparseFieldSetResourceDefinitionTests : IntegrationTestCollection, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicRollbackTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicRollbackTests.cs index 9a5ce48263..e395200e51 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicRollbackTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicRollbackTests.cs @@ -13,7 +13,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Transactions { - public sealed class AtomicRollbackTests : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicRollbackTests : IntegrationTestCollection, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicTransactionConsistencyTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicTransactionConsistencyTests.cs index 882fb6af2e..6b8623e3df 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicTransactionConsistencyTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicTransactionConsistencyTests.cs @@ -14,7 +14,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Transactions { - public sealed class AtomicTransactionConsistencyTests : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicTransactionConsistencyTests : IntegrationTestCollection, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicAddToToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicAddToToManyRelationshipTests.cs index 9692de8205..feb5f364c5 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicAddToToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicAddToToManyRelationshipTests.cs @@ -14,7 +14,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Updating.Relationships { - public sealed class AtomicAddToToManyRelationshipTests : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicAddToToManyRelationshipTests : IntegrationTestCollection, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicRemoveFromToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicRemoveFromToManyRelationshipTests.cs index e05d6ef95c..e8908e405e 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicRemoveFromToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicRemoveFromToManyRelationshipTests.cs @@ -14,7 +14,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Updating.Relationships { - public sealed class AtomicRemoveFromToManyRelationshipTests : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicRemoveFromToManyRelationshipTests : IntegrationTestCollection, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicReplaceToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicReplaceToManyRelationshipTests.cs index 6c093d0bbc..2b436670d0 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicReplaceToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicReplaceToManyRelationshipTests.cs @@ -14,7 +14,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Updating.Relationships { - public sealed class AtomicReplaceToManyRelationshipTests : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicReplaceToManyRelationshipTests : IntegrationTestCollection, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicUpdateToOneRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicUpdateToOneRelationshipTests.cs index cdb1f5581c..eec414fe1a 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicUpdateToOneRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicUpdateToOneRelationshipTests.cs @@ -13,7 +13,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Updating.Relationships { - public sealed class AtomicUpdateToOneRelationshipTests : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicUpdateToOneRelationshipTests : IntegrationTestCollection, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicReplaceToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicReplaceToManyRelationshipTests.cs index 515c3b167b..7d6392728c 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicReplaceToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicReplaceToManyRelationshipTests.cs @@ -14,7 +14,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Updating.Resources { - public sealed class AtomicReplaceToManyRelationshipTests : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicReplaceToManyRelationshipTests : IntegrationTestCollection, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateResourceTests.cs index 1e8e4b8cbd..e3ae498621 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateResourceTests.cs @@ -15,7 +15,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Updating.Resources { - public sealed class AtomicUpdateResourceTests : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicUpdateResourceTests : IntegrationTestCollection, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateToOneRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateToOneRelationshipTests.cs index 8ebbf953c3..3022097f08 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateToOneRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateToOneRelationshipTests.cs @@ -13,7 +13,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Updating.Resources { - public sealed class AtomicUpdateToOneRelationshipTests : IntegrationTestFixture, OperationsDbContext> + public sealed class AtomicUpdateToOneRelationshipTests : IntegrationTestCollection, OperationsDbContext> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CompositeKeys/CompositeKeyTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CompositeKeys/CompositeKeyTests.cs index d723ed92ab..fcc27986eb 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CompositeKeys/CompositeKeyTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CompositeKeys/CompositeKeyTests.cs @@ -14,7 +14,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.CompositeKeys { - public sealed class CompositeKeyTests : IntegrationTestFixture, CompositeDbContext> + public sealed class CompositeKeyTests : IntegrationTestCollection, CompositeDbContext> { private readonly ExampleIntegrationTestContext, CompositeDbContext> _testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/AcceptHeaderTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/AcceptHeaderTests.cs index eb302f8443..0fbb8081c8 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/AcceptHeaderTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/AcceptHeaderTests.cs @@ -12,7 +12,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation { - public sealed class AcceptHeaderTests : IntegrationTestFixture, PolicyDbContext> + public sealed class AcceptHeaderTests : IntegrationTestCollection, PolicyDbContext> { private readonly ExampleIntegrationTestContext, PolicyDbContext> _testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/ContentTypeHeaderTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/ContentTypeHeaderTests.cs index 26f21e69f0..5eb4bd46b9 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/ContentTypeHeaderTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/ContentTypeHeaderTests.cs @@ -11,7 +11,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation { - public sealed class ContentTypeHeaderTests : IntegrationTestFixture, PolicyDbContext> + public sealed class ContentTypeHeaderTests : IntegrationTestCollection, PolicyDbContext> { private readonly ExampleIntegrationTestContext, PolicyDbContext> _testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ControllerActionResults/ActionResultTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ControllerActionResults/ActionResultTests.cs index 87ba1f68f0..0957abba1e 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ControllerActionResults/ActionResultTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ControllerActionResults/ActionResultTests.cs @@ -9,7 +9,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ControllerActionResults { - public sealed class ActionResultTests : IntegrationTestFixture, ActionResultDbContext> + public sealed class ActionResultTests : IntegrationTestCollection, ActionResultDbContext> { private readonly ExampleIntegrationTestContext, ActionResultDbContext> _testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/ApiControllerAttributeTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/ApiControllerAttributeTests.cs index aafe5fc5a6..01f2b54996 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/ApiControllerAttributeTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/ApiControllerAttributeTests.cs @@ -9,7 +9,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.CustomRoutes { - public sealed class ApiControllerAttributeTests : IntegrationTestFixture, CustomRouteDbContext> + public sealed class ApiControllerAttributeTests : IntegrationTestCollection, CustomRouteDbContext> { private readonly ExampleIntegrationTestContext, CustomRouteDbContext> _testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/CustomRouteTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/CustomRouteTests.cs index 84ad2ee7a6..9fa9af6257 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/CustomRouteTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/CustomRouteTests.cs @@ -11,7 +11,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.CustomRoutes { - public sealed class CustomRouteTests : IntegrationTestFixture, CustomRouteDbContext> + public sealed class CustomRouteTests : IntegrationTestCollection, CustomRouteDbContext> { private const string HostPrefix = "http://localhost"; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/EagerLoading/EagerLoadingTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/EagerLoading/EagerLoadingTests.cs index 6ca6b36004..af058aae68 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/EagerLoading/EagerLoadingTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/EagerLoading/EagerLoadingTests.cs @@ -11,7 +11,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.EagerLoading { - public sealed class EagerLoadingTests : IntegrationTestFixture, EagerLoadingDbContext> + public sealed class EagerLoadingTests : IntegrationTestCollection, EagerLoadingDbContext> { private readonly ExampleIntegrationTestContext, EagerLoadingDbContext> _testContext; private readonly EagerLoadingFakers _fakers = new EagerLoadingFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ExceptionHandling/ExceptionHandlerTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ExceptionHandling/ExceptionHandlerTests.cs index 052b46f031..410b642d07 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ExceptionHandling/ExceptionHandlerTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ExceptionHandling/ExceptionHandlerTests.cs @@ -16,7 +16,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ExceptionHandling { - public sealed class ExceptionHandlerTests : IntegrationTestFixture, ErrorDbContext> + public sealed class ExceptionHandlerTests : IntegrationTestCollection, ErrorDbContext> { private readonly ExampleIntegrationTestContext, ErrorDbContext> _testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/HostingInIIS/HostingTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/HostingInIIS/HostingTests.cs index 46037e3a7c..8aa6385297 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/HostingInIIS/HostingTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/HostingInIIS/HostingTests.cs @@ -9,7 +9,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.HostingInIIS { - public sealed class HostingTests : IntegrationTestFixture, HostingDbContext> + public sealed class HostingTests : IntegrationTestCollection, HostingDbContext> { private const string HostPrefix = "http://localhost"; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/IdObfuscation/IdObfuscationTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/IdObfuscation/IdObfuscationTests.cs index 3cf3102138..cfe66e6170 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/IdObfuscation/IdObfuscationTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/IdObfuscation/IdObfuscationTests.cs @@ -11,7 +11,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.IdObfuscation { - public sealed class IdObfuscationTests : IntegrationTestFixture, ObfuscationDbContext> + public sealed class IdObfuscationTests : IntegrationTestCollection, ObfuscationDbContext> { private readonly ExampleIntegrationTestContext, ObfuscationDbContext> _testContext; private readonly ObfuscationFakers _fakers = new ObfuscationFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithNamespaceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithNamespaceTests.cs index 4c9634ca1e..452124c865 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithNamespaceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithNamespaceTests.cs @@ -13,7 +13,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Links { - public sealed class AbsoluteLinksWithNamespaceTests : IntegrationTestFixture, LinksDbContext> + public sealed class AbsoluteLinksWithNamespaceTests : IntegrationTestCollection, LinksDbContext> { private const string HostPrefix = "http://localhost"; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithoutNamespaceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithoutNamespaceTests.cs index 30a773d33a..f3bae4e119 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithoutNamespaceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithoutNamespaceTests.cs @@ -13,7 +13,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Links { - public sealed class AbsoluteLinksWithoutNamespaceTests : IntegrationTestFixture, LinksDbContext> + public sealed class AbsoluteLinksWithoutNamespaceTests : IntegrationTestCollection, LinksDbContext> { private const string HostPrefix = "http://localhost"; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/LinkInclusionTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/LinkInclusionTests.cs index e2fddfe1e4..3c6bab8ad4 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/LinkInclusionTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/LinkInclusionTests.cs @@ -9,7 +9,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Links { - public sealed class LinkInclusionTests : IntegrationTestFixture, LinksDbContext> + public sealed class LinkInclusionTests : IntegrationTestCollection, LinksDbContext> { private readonly ExampleIntegrationTestContext, LinksDbContext> _testContext; private readonly LinksFakers _fakers = new LinksFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithNamespaceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithNamespaceTests.cs index 3ea5ea51d7..20a86ab46b 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithNamespaceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithNamespaceTests.cs @@ -13,7 +13,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Links { - public sealed class RelativeLinksWithNamespaceTests : IntegrationTestFixture, LinksDbContext> + public sealed class RelativeLinksWithNamespaceTests : IntegrationTestCollection, LinksDbContext> { private readonly ExampleIntegrationTestContext, LinksDbContext> _testContext; private readonly LinksFakers _fakers = new LinksFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithoutNamespaceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithoutNamespaceTests.cs index 4e95b9ac26..f6cc3d0940 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithoutNamespaceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithoutNamespaceTests.cs @@ -13,7 +13,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Links { - public sealed class RelativeLinksWithoutNamespaceTests : IntegrationTestFixture, LinksDbContext> + public sealed class RelativeLinksWithoutNamespaceTests : IntegrationTestCollection, LinksDbContext> { private readonly ExampleIntegrationTestContext, LinksDbContext> _testContext; private readonly LinksFakers _fakers = new LinksFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Logging/LoggingTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Logging/LoggingTests.cs index 4d6a9a40f7..e8f5ab26d0 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Logging/LoggingTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Logging/LoggingTests.cs @@ -11,7 +11,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Logging { - public sealed class LoggingTests : IntegrationTestFixture, AuditDbContext> + public sealed class LoggingTests : IntegrationTestCollection, AuditDbContext> { private readonly ExampleIntegrationTestContext, AuditDbContext> _testContext; private readonly AuditFakers _fakers = new AuditFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResourceMetaTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResourceMetaTests.cs index d1c0628752..08862b8d29 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResourceMetaTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResourceMetaTests.cs @@ -12,7 +12,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Meta { - public sealed class ResourceMetaTests : IntegrationTestFixture, SupportDbContext> + public sealed class ResourceMetaTests : IntegrationTestCollection, SupportDbContext> { private readonly ExampleIntegrationTestContext, SupportDbContext> _testContext; private readonly SupportFakers _fakers = new SupportFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResponseMetaTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResponseMetaTests.cs index 92e2b305e7..c52f336062 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResponseMetaTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResponseMetaTests.cs @@ -11,7 +11,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Meta { - public sealed class ResponseMetaTests : IntegrationTestFixture, SupportDbContext> + public sealed class ResponseMetaTests : IntegrationTestCollection, SupportDbContext> { private readonly ExampleIntegrationTestContext, SupportDbContext> _testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/TopLevelCountTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/TopLevelCountTests.cs index 6087e61ef9..bb1cb59817 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/TopLevelCountTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/TopLevelCountTests.cs @@ -12,7 +12,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Meta { - public sealed class TopLevelCountTests : IntegrationTestFixture, SupportDbContext> + public sealed class TopLevelCountTests : IntegrationTestCollection, SupportDbContext> { private readonly ExampleIntegrationTestContext, SupportDbContext> _testContext; private readonly SupportFakers _fakers = new SupportFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/ModelStateValidationTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/ModelStateValidationTests.cs index 3fc1a6a01d..c8f17dd1ab 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/ModelStateValidationTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/ModelStateValidationTests.cs @@ -10,7 +10,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ModelStateValidation { - public sealed class ModelStateValidationTests : IntegrationTestFixture, ModelStateDbContext> + public sealed class ModelStateValidationTests : IntegrationTestCollection, ModelStateDbContext> { private readonly ExampleIntegrationTestContext, ModelStateDbContext> _testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/NoModelStateValidationTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/NoModelStateValidationTests.cs index dff9ffb7ec..6253e671af 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/NoModelStateValidationTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/NoModelStateValidationTests.cs @@ -9,7 +9,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ModelStateValidation { - public sealed class NoModelStateValidationTests : IntegrationTestFixture, ModelStateDbContext> + public sealed class NoModelStateValidationTests : IntegrationTestCollection, ModelStateDbContext> { private readonly ExampleIntegrationTestContext, ModelStateDbContext> _testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NamingConventions/KebabCasingTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NamingConventions/KebabCasingTests.cs index 3ac051b83a..238ae12385 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NamingConventions/KebabCasingTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NamingConventions/KebabCasingTests.cs @@ -9,7 +9,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.NamingConventions { - public sealed class KebabCasingTests : IntegrationTestFixture, SwimmingDbContext> + public sealed class KebabCasingTests : IntegrationTestCollection, SwimmingDbContext> { private readonly ExampleIntegrationTestContext, SwimmingDbContext> _testContext; private readonly SwimmingFakers _fakers = new SwimmingFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDataTypeTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDataTypeTests.cs index e38b7d47b2..ff7f5a26e2 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDataTypeTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDataTypeTests.cs @@ -16,7 +16,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.Filtering { - public sealed class FilterDataTypeTests : IntegrationTestFixture, FilterDbContext> + public sealed class FilterDataTypeTests : IntegrationTestCollection, FilterDbContext> { private readonly ExampleIntegrationTestContext, FilterDbContext> _testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDepthTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDepthTests.cs index d1b43546ee..05642164af 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDepthTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDepthTests.cs @@ -14,7 +14,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.Filtering { - public sealed class FilterDepthTests : IntegrationTestFixture, QueryStringDbContext> + public sealed class FilterDepthTests : IntegrationTestCollection, QueryStringDbContext> { private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; private readonly QueryStringFakers _fakers = new QueryStringFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterOperatorTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterOperatorTests.cs index 14a10cc854..c7a64575e5 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterOperatorTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterOperatorTests.cs @@ -16,7 +16,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.Filtering { - public sealed class FilterOperatorTests : IntegrationTestFixture, FilterDbContext> + public sealed class FilterOperatorTests : IntegrationTestCollection, FilterDbContext> { private readonly ExampleIntegrationTestContext, FilterDbContext> _testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterTests.cs index a2c0423e45..ae504ad915 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterTests.cs @@ -12,7 +12,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.Filtering { - public sealed class FilterTests : IntegrationTestFixture, QueryStringDbContext> + public sealed class FilterTests : IntegrationTestCollection, QueryStringDbContext> { private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; private readonly QueryStringFakers _fakers = new QueryStringFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Includes/IncludeTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Includes/IncludeTests.cs index 4dffaebb2a..3e56c4fd17 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Includes/IncludeTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Includes/IncludeTests.cs @@ -13,7 +13,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.Includes { - public sealed class IncludeTests : IntegrationTestFixture, QueryStringDbContext> + public sealed class IncludeTests : IntegrationTestCollection, QueryStringDbContext> { private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; private readonly QueryStringFakers _fakers = new QueryStringFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithTotalCountTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithTotalCountTests.cs index 2fecf283aa..d012313ed8 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithTotalCountTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithTotalCountTests.cs @@ -13,7 +13,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.Pagination { - public sealed class PaginationWithTotalCountTests : IntegrationTestFixture, QueryStringDbContext> + public sealed class PaginationWithTotalCountTests : IntegrationTestCollection, QueryStringDbContext> { private const string HostPrefix = "http://localhost"; private const int DefaultPageSize = 5; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithoutTotalCountTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithoutTotalCountTests.cs index b3795abde9..dd2babc233 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithoutTotalCountTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithoutTotalCountTests.cs @@ -12,7 +12,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.Pagination { - public sealed class PaginationWithoutTotalCountTests : IntegrationTestFixture, QueryStringDbContext> + public sealed class PaginationWithoutTotalCountTests : IntegrationTestCollection, QueryStringDbContext> { private const string HostPrefix = "http://localhost"; private const int DefaultPageSize = 5; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationTests.cs index 8233a36c11..903b5c3f42 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationTests.cs @@ -12,7 +12,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.Pagination { - public sealed class RangeValidationTests : IntegrationTestFixture, QueryStringDbContext> + public sealed class RangeValidationTests : IntegrationTestCollection, QueryStringDbContext> { private const int DefaultPageSize = 5; private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationWithMaximumTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationWithMaximumTests.cs index 5ee8d0fd48..b95c3bdf0f 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationWithMaximumTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationWithMaximumTests.cs @@ -11,7 +11,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.Pagination { - public sealed class RangeValidationWithMaximumTests : IntegrationTestFixture, QueryStringDbContext> + public sealed class RangeValidationWithMaximumTests : IntegrationTestCollection, QueryStringDbContext> { private const int MaximumPageSize = 15; private const int MaximumPageNumber = 20; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/QueryStringTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/QueryStringTests.cs index 170e44d69b..9c0af99c51 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/QueryStringTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/QueryStringTests.cs @@ -11,7 +11,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings { - public sealed class QueryStringTests : IntegrationTestFixture, QueryStringDbContext> + public sealed class QueryStringTests : IntegrationTestCollection, QueryStringDbContext> { private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerDefaultValueHandlingTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerDefaultValueHandlingTests.cs index 1aa1efef0a..5e35f1d05d 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerDefaultValueHandlingTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerDefaultValueHandlingTests.cs @@ -13,7 +13,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings { - public sealed class SerializerDefaultValueHandlingTests : IntegrationTestFixture, QueryStringDbContext> + public sealed class SerializerDefaultValueHandlingTests : IntegrationTestCollection, QueryStringDbContext> { private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; private readonly QueryStringFakers _fakers = new QueryStringFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerNullValueHandlingTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerNullValueHandlingTests.cs index 6a504c4c8c..02d50b97b8 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerNullValueHandlingTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerNullValueHandlingTests.cs @@ -13,7 +13,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings { - public sealed class SerializerNullValueHandlingTests : IntegrationTestFixture, QueryStringDbContext> + public sealed class SerializerNullValueHandlingTests : IntegrationTestCollection, QueryStringDbContext> { private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; private readonly QueryStringFakers _fakers = new QueryStringFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Sorting/SortTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Sorting/SortTests.cs index df5966a254..82e02a9948 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Sorting/SortTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Sorting/SortTests.cs @@ -12,7 +12,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.Sorting { - public sealed class SortTests : IntegrationTestFixture, QueryStringDbContext> + public sealed class SortTests : IntegrationTestCollection, QueryStringDbContext> { private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; private readonly QueryStringFakers _fakers = new QueryStringFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SparseFieldSets/SparseFieldSetTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SparseFieldSets/SparseFieldSetTests.cs index 84f8fa9daa..d1f885fbc8 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SparseFieldSets/SparseFieldSetTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SparseFieldSets/SparseFieldSetTests.cs @@ -13,7 +13,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.SparseFieldSets { - public sealed class SparseFieldSetTests : IntegrationTestFixture, QueryStringDbContext> + public sealed class SparseFieldSetTests : IntegrationTestCollection, QueryStringDbContext> { private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; private readonly QueryStringFakers _fakers = new QueryStringFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceTests.cs index 50a73cf622..da8196dae8 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceTests.cs @@ -17,7 +17,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Creating { - public sealed class CreateResourceTests : IntegrationTestFixture, ReadWriteDbContext> + public sealed class CreateResourceTests : IntegrationTestCollection, ReadWriteDbContext> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithClientGeneratedIdTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithClientGeneratedIdTests.cs index f364d83b93..62158bc631 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithClientGeneratedIdTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithClientGeneratedIdTests.cs @@ -14,7 +14,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Creating { - public sealed class CreateResourceWithClientGeneratedIdTests : IntegrationTestFixture, ReadWriteDbContext> + public sealed class CreateResourceWithClientGeneratedIdTests : IntegrationTestCollection, ReadWriteDbContext> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToManyRelationshipTests.cs index 20b2d48dd6..c1cb44bdad 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToManyRelationshipTests.cs @@ -12,7 +12,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Creating { - public sealed class CreateResourceWithToManyRelationshipTests : IntegrationTestFixture, ReadWriteDbContext> + public sealed class CreateResourceWithToManyRelationshipTests : IntegrationTestCollection, ReadWriteDbContext> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToOneRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToOneRelationshipTests.cs index 8c24fc5e65..fbce50e3e5 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToOneRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToOneRelationshipTests.cs @@ -15,7 +15,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Creating { - public sealed class CreateResourceWithToOneRelationshipTests : IntegrationTestFixture, ReadWriteDbContext> + public sealed class CreateResourceWithToOneRelationshipTests : IntegrationTestCollection, ReadWriteDbContext> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Deleting/DeleteResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Deleting/DeleteResourceTests.cs index 4e86be7c59..c668df66dd 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Deleting/DeleteResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Deleting/DeleteResourceTests.cs @@ -12,7 +12,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Deleting { - public sealed class DeleteResourceTests : IntegrationTestFixture, ReadWriteDbContext> + public sealed class DeleteResourceTests : IntegrationTestCollection, ReadWriteDbContext> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchRelationshipTests.cs index 2f11edfefa..d3a7a68d78 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchRelationshipTests.cs @@ -11,7 +11,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Fetching { - public sealed class FetchRelationshipTests : IntegrationTestFixture, ReadWriteDbContext> + public sealed class FetchRelationshipTests : IntegrationTestCollection, ReadWriteDbContext> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchResourceTests.cs index e2ac1b0a0b..ce9492cf1f 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchResourceTests.cs @@ -11,7 +11,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Fetching { - public sealed class FetchResourceTests : IntegrationTestFixture, ReadWriteDbContext> + public sealed class FetchResourceTests : IntegrationTestCollection, ReadWriteDbContext> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/AddToToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/AddToToManyRelationshipTests.cs index 3ead3160f6..c48401fcbb 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/AddToToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/AddToToManyRelationshipTests.cs @@ -12,7 +12,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Updating.Relationships { - public sealed class AddToToManyRelationshipTests : IntegrationTestFixture, ReadWriteDbContext> + public sealed class AddToToManyRelationshipTests : IntegrationTestCollection, ReadWriteDbContext> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/RemoveFromToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/RemoveFromToManyRelationshipTests.cs index 39e07b4b52..1cf7590c34 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/RemoveFromToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/RemoveFromToManyRelationshipTests.cs @@ -12,7 +12,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Updating.Relationships { - public sealed class RemoveFromToManyRelationshipTests : IntegrationTestFixture, ReadWriteDbContext> + public sealed class RemoveFromToManyRelationshipTests : IntegrationTestCollection, ReadWriteDbContext> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/ReplaceToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/ReplaceToManyRelationshipTests.cs index f041d77753..0b17dc3d1f 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/ReplaceToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/ReplaceToManyRelationshipTests.cs @@ -12,7 +12,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Updating.Relationships { - public sealed class ReplaceToManyRelationshipTests : IntegrationTestFixture, ReadWriteDbContext> + public sealed class ReplaceToManyRelationshipTests : IntegrationTestCollection, ReadWriteDbContext> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/UpdateToOneRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/UpdateToOneRelationshipTests.cs index 8a78c98fa4..d6b62e9153 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/UpdateToOneRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/UpdateToOneRelationshipTests.cs @@ -12,7 +12,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Updating.Relationships { - public sealed class UpdateToOneRelationshipTests : IntegrationTestFixture, ReadWriteDbContext> + public sealed class UpdateToOneRelationshipTests : IntegrationTestCollection, ReadWriteDbContext> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/ReplaceToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/ReplaceToManyRelationshipTests.cs index 5982f7f960..c0ef12b73d 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/ReplaceToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/ReplaceToManyRelationshipTests.cs @@ -13,7 +13,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Updating.Resources { - public sealed class ReplaceToManyRelationshipTests : IntegrationTestFixture, ReadWriteDbContext> + public sealed class ReplaceToManyRelationshipTests : IntegrationTestCollection, ReadWriteDbContext> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateResourceTests.cs index 7002b57652..ba3df637e3 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateResourceTests.cs @@ -15,7 +15,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Updating.Resources { - public sealed class UpdateResourceTests : IntegrationTestFixture, ReadWriteDbContext> + public sealed class UpdateResourceTests : IntegrationTestCollection, ReadWriteDbContext> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateToOneRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateToOneRelationshipTests.cs index d613817969..141f9924f4 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateToOneRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateToOneRelationshipTests.cs @@ -12,7 +12,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Updating.Resources { - public sealed class UpdateToOneRelationshipTests : IntegrationTestFixture, ReadWriteDbContext> + public sealed class UpdateToOneRelationshipTests : IntegrationTestCollection, ReadWriteDbContext> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RequiredRelationships/DefaultBehaviorTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RequiredRelationships/DefaultBehaviorTests.cs index 9a8958cafd..6b7072a110 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RequiredRelationships/DefaultBehaviorTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RequiredRelationships/DefaultBehaviorTests.cs @@ -11,7 +11,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.RequiredRelationships { - public sealed class DefaultBehaviorTests : IntegrationTestFixture, DefaultBehaviorDbContext> + public sealed class DefaultBehaviorTests : IntegrationTestCollection, DefaultBehaviorDbContext> { private readonly ExampleIntegrationTestContext, DefaultBehaviorDbContext> _testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceConstructorInjection/ResourceInjectionTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceConstructorInjection/ResourceInjectionTests.cs index 5997fa5457..052d1fda32 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceConstructorInjection/ResourceInjectionTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceConstructorInjection/ResourceInjectionTests.cs @@ -15,7 +15,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ResourceConstructorInjection { - public sealed class ResourceInjectionTests : IntegrationTestFixture, InjectionDbContext> + public sealed class ResourceInjectionTests : IntegrationTestCollection, InjectionDbContext> { private readonly ExampleIntegrationTestContext, InjectionDbContext> _testContext; private readonly InjectionFakers _fakers; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceDefinitions/ResourceDefinitionQueryCallbackTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceDefinitions/ResourceDefinitionQueryCallbackTests.cs index 775bd88135..8b69dca2ee 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceDefinitions/ResourceDefinitionQueryCallbackTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceDefinitions/ResourceDefinitionQueryCallbackTests.cs @@ -14,7 +14,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ResourceDefinitions { - public sealed class ResourceDefinitionQueryCallbackTests : IntegrationTestFixture, CallableDbContext> + public sealed class ResourceDefinitionQueryCallbackTests : IntegrationTestCollection, CallableDbContext> { private readonly ExampleIntegrationTestContext, CallableDbContext> _testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceInheritance/InheritanceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceInheritance/InheritanceTests.cs index 066baa0d15..fb070f593e 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceInheritance/InheritanceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceInheritance/InheritanceTests.cs @@ -13,7 +13,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ResourceInheritance { - public sealed class InheritanceTests : IntegrationTestFixture, InheritanceDbContext> + public sealed class InheritanceTests : IntegrationTestCollection, InheritanceDbContext> { private readonly ExampleIntegrationTestContext, InheritanceDbContext> _testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/DisableQueryStringTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/DisableQueryStringTests.cs index 16c674ac95..d25e891bf7 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/DisableQueryStringTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/DisableQueryStringTests.cs @@ -11,7 +11,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.RestrictedControllers { - public sealed class DisableQueryStringTests : IntegrationTestFixture, RestrictionDbContext> + public sealed class DisableQueryStringTests : IntegrationTestCollection, RestrictionDbContext> { private readonly ExampleIntegrationTestContext, RestrictionDbContext> _testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/HttpReadOnlyTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/HttpReadOnlyTests.cs index 1bff32f961..37a6207832 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/HttpReadOnlyTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/HttpReadOnlyTests.cs @@ -9,7 +9,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.RestrictedControllers { - public sealed class HttpReadOnlyTests : IntegrationTestFixture, RestrictionDbContext> + public sealed class HttpReadOnlyTests : IntegrationTestCollection, RestrictionDbContext> { private readonly ExampleIntegrationTestContext, RestrictionDbContext> _testContext; private readonly RestrictionFakers _fakers = new RestrictionFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpDeleteTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpDeleteTests.cs index 890bf38f06..6f1e51af87 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpDeleteTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpDeleteTests.cs @@ -9,7 +9,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.RestrictedControllers { - public sealed class NoHttpDeleteTests : IntegrationTestFixture, RestrictionDbContext> + public sealed class NoHttpDeleteTests : IntegrationTestCollection, RestrictionDbContext> { private readonly ExampleIntegrationTestContext, RestrictionDbContext> _testContext; private readonly RestrictionFakers _fakers = new RestrictionFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPatchTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPatchTests.cs index 2203033f56..f0fb855bc2 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPatchTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPatchTests.cs @@ -9,7 +9,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.RestrictedControllers { - public sealed class NoHttpPatchTests : IntegrationTestFixture, RestrictionDbContext> + public sealed class NoHttpPatchTests : IntegrationTestCollection, RestrictionDbContext> { private readonly ExampleIntegrationTestContext, RestrictionDbContext> _testContext; private readonly RestrictionFakers _fakers = new RestrictionFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPostTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPostTests.cs index 6c45b16a03..cbffda45d6 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPostTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPostTests.cs @@ -9,7 +9,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.RestrictedControllers { - public sealed class NoHttpPostTests : IntegrationTestFixture, RestrictionDbContext> + public sealed class NoHttpPostTests : IntegrationTestCollection, RestrictionDbContext> { private readonly ExampleIntegrationTestContext, RestrictionDbContext> _testContext; private readonly RestrictionFakers _fakers = new RestrictionFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Serialization/SerializationTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Serialization/SerializationTests.cs index 795a4e0944..bb26555d15 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Serialization/SerializationTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Serialization/SerializationTests.cs @@ -17,7 +17,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Serialization { - public sealed class SerializationTests : IntegrationTestFixture, SerializationDbContext> + public sealed class SerializationTests : IntegrationTestCollection, SerializationDbContext> { private readonly ExampleIntegrationTestContext, SerializationDbContext> _testContext; private readonly SerializationFakers _fakers = new SerializationFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/SoftDeletion/SoftDeletionTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/SoftDeletion/SoftDeletionTests.cs index 0a47292e31..739420cbdc 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/SoftDeletion/SoftDeletionTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/SoftDeletion/SoftDeletionTests.cs @@ -13,7 +13,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.SoftDeletion { - public sealed class SoftDeletionTests : IntegrationTestFixture, SoftDeletionDbContext> + public sealed class SoftDeletionTests : IntegrationTestCollection, SoftDeletionDbContext> { private readonly ExampleIntegrationTestContext, SoftDeletionDbContext> _testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/EmptyGuidAsKeyTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/EmptyGuidAsKeyTests.cs index 0d359592ae..e994614f2f 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/EmptyGuidAsKeyTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/EmptyGuidAsKeyTests.cs @@ -15,7 +15,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ZeroKeys { - public sealed class EmptyGuidAsKeyTests : IntegrationTestFixture, ZeroKeyDbContext> + public sealed class EmptyGuidAsKeyTests : IntegrationTestCollection, ZeroKeyDbContext> { private readonly ExampleIntegrationTestContext, ZeroKeyDbContext> _testContext; private readonly ZeroKeyFakers _fakers = new ZeroKeyFakers(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/ZeroAsKeyTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/ZeroAsKeyTests.cs index 315272b4de..ec8aae49c7 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/ZeroAsKeyTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/ZeroAsKeyTests.cs @@ -14,7 +14,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ZeroKeys { - public sealed class ZeroAsKeyTests : IntegrationTestFixture, ZeroKeyDbContext> + public sealed class ZeroAsKeyTests : IntegrationTestCollection, ZeroKeyDbContext> { private readonly ExampleIntegrationTestContext, ZeroKeyDbContext> _testContext; private readonly ZeroKeyFakers _fakers = new ZeroKeyFakers(); diff --git a/test/TestBuildingBlocks/ServiceCollectionExtensions.cs b/test/TestBuildingBlocks/ServiceCollectionExtensions.cs index 90b1d67aba..2156d304f4 100644 --- a/test/TestBuildingBlocks/ServiceCollectionExtensions.cs +++ b/test/TestBuildingBlocks/ServiceCollectionExtensions.cs @@ -9,7 +9,7 @@ namespace TestBuildingBlocks { public static class ServiceCollectionExtensions { - public static void UseControllers(this IServiceCollection services, TestControllerProvider provider) + internal static void UseControllers(this IServiceCollection services, TestControllerProvider provider) { ArgumentGuard.NotNull(services, nameof(services)); diff --git a/test/TestBuildingBlocks/TestControllerProvider.cs b/test/TestBuildingBlocks/TestControllerProvider.cs index 3d3b293db8..3c70daf013 100644 --- a/test/TestBuildingBlocks/TestControllerProvider.cs +++ b/test/TestBuildingBlocks/TestControllerProvider.cs @@ -6,7 +6,7 @@ namespace TestBuildingBlocks { - public sealed class TestControllerProvider : ControllerFeatureProvider + internal sealed class TestControllerProvider : ControllerFeatureProvider { private readonly IList _namespaceEntryPoints = new List(); private readonly IList _allowedControllerTypes = new List(); From 4d21fc60581d4328ba6df8e42338250b947af364 Mon Sep 17 00:00:00 2001 From: maurei Date: Wed, 17 Mar 2021 12:41:17 +0100 Subject: [PATCH 11/18] code inspection --- src/JsonApiDotNetCore/Middleware/HeaderConstants.cs | 3 +++ test/TestBuildingBlocks/ServiceCollectionExtensions.cs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/JsonApiDotNetCore/Middleware/HeaderConstants.cs b/src/JsonApiDotNetCore/Middleware/HeaderConstants.cs index 0a93c9269c..c860204c52 100644 --- a/src/JsonApiDotNetCore/Middleware/HeaderConstants.cs +++ b/src/JsonApiDotNetCore/Middleware/HeaderConstants.cs @@ -1,7 +1,10 @@ +using JetBrains.Annotations; + #pragma warning disable AV1008 // Class should not be static namespace JsonApiDotNetCore.Middleware { + [PublicAPI] public static class HeaderConstants { public const string MediaType = "application/vnd.api+json"; diff --git a/test/TestBuildingBlocks/ServiceCollectionExtensions.cs b/test/TestBuildingBlocks/ServiceCollectionExtensions.cs index 2156d304f4..92df0a2b47 100644 --- a/test/TestBuildingBlocks/ServiceCollectionExtensions.cs +++ b/test/TestBuildingBlocks/ServiceCollectionExtensions.cs @@ -7,9 +7,9 @@ namespace TestBuildingBlocks { - public static class ServiceCollectionExtensions + internal static class ServiceCollectionExtensions { - internal static void UseControllers(this IServiceCollection services, TestControllerProvider provider) + public static void UseControllers(this IServiceCollection services, TestControllerProvider provider) { ArgumentGuard.NotNull(services, nameof(services)); From b7fe854673df6062ae9c2facb698a804c0bed023 Mon Sep 17 00:00:00 2001 From: maurei Date: Wed, 17 Mar 2021 16:25:04 +0100 Subject: [PATCH 12/18] explicit controller registration --- .../Controllers}/NonJsonApiController.cs | 2 +- .../IntegrationTestCollection.cs | 15 ---- ...micConstrainedOperationsControllerTests.cs | 7 +- .../Creating/AtomicCreateResourceTests.cs | 3 +- ...reateResourceWithClientGeneratedIdTests.cs | 4 +- ...eateResourceWithToManyRelationshipTests.cs | 4 +- ...reateResourceWithToOneRelationshipTests.cs | 4 +- .../Deleting/AtomicDeleteResourceTests.cs | 3 +- .../Links/AtomicAbsoluteLinksTests.cs | 3 +- .../AtomicRelativeLinksWithNamespaceTests.cs | 3 +- .../LocalIds/AtomicLocalIdTests.cs | 3 +- .../Meta/AtomicResourceMetaTests.cs | 3 +- .../Meta/AtomicResponseMetaTests.cs | 3 +- .../Mixed/AtomicRequestBodyTests.cs | 3 +- .../Mixed/MaximumOperationsPerRequestTests.cs | 4 +- .../AtomicModelStateValidationTests.cs | 4 +- .../QueryStrings/AtomicQueryStringTests.cs | 4 +- ...icSparseFieldSetResourceDefinitionTests.cs | 4 +- .../Transactions/AtomicRollbackTests.cs | 3 +- .../AtomicTransactionConsistencyTests.cs | 4 +- .../AtomicAddToToManyRelationshipTests.cs | 4 +- ...AtomicRemoveFromToManyRelationshipTests.cs | 4 +- .../AtomicReplaceToManyRelationshipTests.cs | 4 +- .../AtomicUpdateToOneRelationshipTests.cs | 4 +- .../AtomicReplaceToManyRelationshipTests.cs | 4 +- .../Resources/AtomicUpdateResourceTests.cs | 3 +- .../AtomicUpdateToOneRelationshipTests.cs | 4 +- .../CompositeKeys/CompositeKeyTests.cs | 7 +- .../ContentNegotiation/AcceptHeaderTests.cs | 4 +- .../ContentTypeHeaderTests.cs | 4 +- .../ActionResultTests.cs | 5 +- .../ApiControllerAttributeTests.cs | 5 +- .../CustomRoutes/CustomRouteTests.cs | 6 +- .../EagerLoading/EagerLoadingTests.cs | 7 +- .../ExceptionHandlerTests.cs | 6 +- .../HostingInIIS/HostingTests.cs | 6 +- .../IdObfuscation/IdObfuscationTests.cs | 6 +- .../Links/AbsoluteLinksWithNamespaceTests.cs | 7 +- .../AbsoluteLinksWithoutNamespaceTests.cs | 7 +- .../Links/LinkInclusionTests.cs | 5 +- .../Links/RelativeLinksWithNamespaceTests.cs | 7 +- .../RelativeLinksWithoutNamespaceTests.cs | 7 +- .../IntegrationTests/Logging/LoggingTests.cs | 5 +- .../Meta/ResourceMetaTests.cs | 6 +- .../Meta/ResponseMetaTests.cs | 6 +- .../Meta/TopLevelCountTests.cs | 6 +- .../ModelStateValidationTests.cs | 7 +- .../NoModelStateValidationTests.cs | 6 +- .../NamingConventions/KebabCasingTests.cs | 6 +- .../NonJsonApiControllerTests.cs | 23 +++--- .../Filtering/FilterDataTypeTests.cs | 5 +- .../Filtering/FilterDepthTests.cs | 6 +- .../Filtering/FilterOperatorTests.cs | 5 +- .../QueryStrings/Filtering/FilterTests.cs | 5 +- .../QueryStrings/Includes/IncludeTests.cs | 8 +- .../PaginationWithTotalCountTests.cs | 8 +- .../PaginationWithoutTotalCountTests.cs | 7 +- .../Pagination/RangeValidationTests.cs | 5 +- .../RangeValidationWithMaximumTests.cs | 6 +- .../QueryStrings/QueryStringTests.cs | 5 +- .../SerializerDefaultValueHandlingTests.cs | 6 +- .../SerializerNullValueHandlingTests.cs | 6 +- .../QueryStrings/Sorting/SortTests.cs | 7 +- .../SparseFieldSets/SparseFieldSetTests.cs | 77 ++++++++++--------- .../ReadWrite/Creating/CreateResourceTests.cs | 8 +- ...reateResourceWithClientGeneratedIdTests.cs | 7 +- ...eateResourceWithToManyRelationshipTests.cs | 7 +- ...reateResourceWithToOneRelationshipTests.cs | 8 +- .../ReadWrite/Deleting/DeleteResourceTests.cs | 7 +- .../Fetching/FetchRelationshipTests.cs | 6 +- .../ReadWrite/Fetching/FetchResourceTests.cs | 6 +- .../AddToToManyRelationshipTests.cs | 5 +- .../RemoveFromToManyRelationshipTests.cs | 6 +- .../ReplaceToManyRelationshipTests.cs | 5 +- .../UpdateToOneRelationshipTests.cs | 7 +- .../ReplaceToManyRelationshipTests.cs | 5 +- .../Updating/Resources/UpdateResourceTests.cs | 8 +- .../Resources/UpdateToOneRelationshipTests.cs | 7 +- .../DefaultBehaviorTests.cs | 10 ++- .../ResourceInjectionTests.cs | 6 +- .../ResourceDefinitionQueryCallbackTests.cs | 6 +- .../ResourceHooks/ResourceHookTests.cs | 7 +- .../ResourceInheritance/InheritanceTests.cs | 5 +- .../DisableQueryStringTests.cs | 6 +- .../HttpReadOnlyTests.cs | 5 +- .../NoHttpDeleteTests.cs | 5 +- .../RestrictedControllers/NoHttpPatchTests.cs | 5 +- .../RestrictedControllers/NoHttpPostTests.cs | 5 +- .../Serialization/SerializationTests.cs | 6 +- .../SoftDeletion/SoftDeletionTests.cs | 6 +- .../ZeroKeys/EmptyGuidAsKeyTests.cs | 7 +- .../ZeroKeys/ZeroAsKeyTests.cs | 7 +- .../BaseIntegrationTestContext.cs | 8 +- .../TestControllerProvider.cs | 14 +--- 94 files changed, 359 insertions(+), 261 deletions(-) rename {test/JsonApiDotNetCoreExampleTests/IntegrationTests/NonJsonApiControllers => src/Examples/JsonApiDotNetCoreExample/Controllers}/NonJsonApiController.cs (93%) delete mode 100644 test/JsonApiDotNetCoreExampleTests/IntegrationTestCollection.cs diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NonJsonApiControllers/NonJsonApiController.cs b/src/Examples/JsonApiDotNetCoreExample/Controllers/NonJsonApiController.cs similarity index 93% rename from test/JsonApiDotNetCoreExampleTests/IntegrationTests/NonJsonApiControllers/NonJsonApiController.cs rename to src/Examples/JsonApiDotNetCoreExample/Controllers/NonJsonApiController.cs index 052ac3ba4d..49708c5465 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NonJsonApiControllers/NonJsonApiController.cs +++ b/src/Examples/JsonApiDotNetCoreExample/Controllers/NonJsonApiController.cs @@ -2,7 +2,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; -namespace JsonApiDotNetCoreExampleTests.IntegrationTests.NonJsonApiControllers +namespace JsonApiDotNetCoreExample.Controllers { [Route("[controller]")] public sealed class NonJsonApiController : ControllerBase diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTestCollection.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTestCollection.cs deleted file mode 100644 index 6deb8d890d..0000000000 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTestCollection.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Xunit; - -namespace JsonApiDotNetCoreExampleTests -{ - public abstract class IntegrationTestCollection : IClassFixture> - where TStartup : class - where TDbContext : DbContext - { - protected IntegrationTestCollection(ExampleIntegrationTestContext testContext) - { - testContext.AddControllersInNamespaceOf(); - } - } -} diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Controllers/AtomicConstrainedOperationsControllerTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Controllers/AtomicConstrainedOperationsControllerTests.cs index 4a0e5e577b..eea3046331 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Controllers/AtomicConstrainedOperationsControllerTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Controllers/AtomicConstrainedOperationsControllerTests.cs @@ -3,24 +3,23 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCore.Serialization.Objects; -using JsonApiDotNetCoreExample.Controllers; using JsonApiDotNetCoreExampleTests.Startups; using TestBuildingBlocks; using Xunit; namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Controllers { - public sealed class AtomicConstrainedOperationsControllerTests : IntegrationTestCollection, OperationsDbContext> + public sealed class AtomicConstrainedOperationsControllerTests + : IClassFixture, OperationsDbContext>> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); public AtomicConstrainedOperationsControllerTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) - : base(testContext) { _testContext = testContext; - testContext.AddController(); + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceTests.cs index 5dbec1f812..41f182ea46 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceTests.cs @@ -15,13 +15,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Creating { - public sealed class AtomicCreateResourceTests : IntegrationTestCollection, OperationsDbContext> + public sealed class AtomicCreateResourceTests : IClassFixture, OperationsDbContext>> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); public AtomicCreateResourceTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) - : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithClientGeneratedIdTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithClientGeneratedIdTests.cs index 2f46b95065..f66ebfc6d2 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithClientGeneratedIdTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithClientGeneratedIdTests.cs @@ -13,14 +13,14 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Creating { - public sealed class AtomicCreateResourceWithClientGeneratedIdTests : IntegrationTestCollection, OperationsDbContext> + public sealed class AtomicCreateResourceWithClientGeneratedIdTests + : IClassFixture, OperationsDbContext>> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); public AtomicCreateResourceWithClientGeneratedIdTests( ExampleIntegrationTestContext, OperationsDbContext> testContext) - : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToManyRelationshipTests.cs index 7de3a03ecd..263eb0fd95 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToManyRelationshipTests.cs @@ -13,14 +13,14 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Creating { - public sealed class AtomicCreateResourceWithToManyRelationshipTests : IntegrationTestCollection, OperationsDbContext> + public sealed class AtomicCreateResourceWithToManyRelationshipTests + : IClassFixture, OperationsDbContext>> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); public AtomicCreateResourceWithToManyRelationshipTests( ExampleIntegrationTestContext, OperationsDbContext> testContext) - : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToOneRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToOneRelationshipTests.cs index ff0a6f5fe1..337cd1ccf5 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToOneRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToOneRelationshipTests.cs @@ -15,14 +15,14 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Creating { - public sealed class AtomicCreateResourceWithToOneRelationshipTests : IntegrationTestCollection, OperationsDbContext> + public sealed class AtomicCreateResourceWithToOneRelationshipTests + : IClassFixture, OperationsDbContext>> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); public AtomicCreateResourceWithToOneRelationshipTests( ExampleIntegrationTestContext, OperationsDbContext> testContext) - : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Deleting/AtomicDeleteResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Deleting/AtomicDeleteResourceTests.cs index 2446039a22..e022ea3c9d 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Deleting/AtomicDeleteResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Deleting/AtomicDeleteResourceTests.cs @@ -14,13 +14,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Deleting { - public sealed class AtomicDeleteResourceTests : IntegrationTestCollection, OperationsDbContext> + public sealed class AtomicDeleteResourceTests : IClassFixture, OperationsDbContext>> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); public AtomicDeleteResourceTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) - : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicAbsoluteLinksTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicAbsoluteLinksTests.cs index 8f9e800192..5bc7ce5095 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicAbsoluteLinksTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicAbsoluteLinksTests.cs @@ -12,7 +12,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Links { - public sealed class AtomicAbsoluteLinksTests : IntegrationTestCollection, OperationsDbContext> + public sealed class AtomicAbsoluteLinksTests : IClassFixture, OperationsDbContext>> { private const string HostPrefix = "http://localhost"; @@ -20,7 +20,6 @@ public sealed class AtomicAbsoluteLinksTests : IntegrationTestCollection, OperationsDbContext> testContext) - : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicRelativeLinksWithNamespaceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicRelativeLinksWithNamespaceTests.cs index 866c7cdc0f..a41ff6619f 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicRelativeLinksWithNamespaceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicRelativeLinksWithNamespaceTests.cs @@ -14,13 +14,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Links { public sealed class AtomicRelativeLinksWithNamespaceTests - : IntegrationTestCollection, OperationsDbContext> + : IClassFixture, OperationsDbContext>> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; public AtomicRelativeLinksWithNamespaceTests( ExampleIntegrationTestContext, OperationsDbContext> testContext) - : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/LocalIds/AtomicLocalIdTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/LocalIds/AtomicLocalIdTests.cs index 97ead8e2fa..bd337db65d 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/LocalIds/AtomicLocalIdTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/LocalIds/AtomicLocalIdTests.cs @@ -13,13 +13,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.LocalIds { - public sealed class AtomicLocalIdTests : IntegrationTestCollection, OperationsDbContext> + public sealed class AtomicLocalIdTests : IClassFixture, OperationsDbContext>> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); public AtomicLocalIdTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) - : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResourceMetaTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResourceMetaTests.cs index 19d2d2123a..177871c679 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResourceMetaTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResourceMetaTests.cs @@ -14,13 +14,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Meta { - public sealed class AtomicResourceMetaTests : IntegrationTestCollection, OperationsDbContext> + public sealed class AtomicResourceMetaTests : IClassFixture, OperationsDbContext>> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); public AtomicResourceMetaTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) - : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResponseMetaTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResponseMetaTests.cs index 7c3d6868fb..22d0932e3c 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResponseMetaTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResponseMetaTests.cs @@ -15,13 +15,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Meta { - public sealed class AtomicResponseMetaTests : IntegrationTestCollection, OperationsDbContext> + public sealed class AtomicResponseMetaTests : IClassFixture, OperationsDbContext>> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); public AtomicResponseMetaTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) - : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/AtomicRequestBodyTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/AtomicRequestBodyTests.cs index a4c7cff9ab..2ca232c05d 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/AtomicRequestBodyTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/AtomicRequestBodyTests.cs @@ -12,12 +12,11 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Mixed { - public sealed class AtomicRequestBodyTests : IntegrationTestCollection, OperationsDbContext> + public sealed class AtomicRequestBodyTests : IClassFixture, OperationsDbContext>> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; public AtomicRequestBodyTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) - : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/MaximumOperationsPerRequestTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/MaximumOperationsPerRequestTests.cs index 00768eeefb..20aa77ab0c 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/MaximumOperationsPerRequestTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/MaximumOperationsPerRequestTests.cs @@ -13,12 +13,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Mixed { - public sealed class MaximumOperationsPerRequestTests : IntegrationTestCollection, OperationsDbContext> + public sealed class MaximumOperationsPerRequestTests + : IClassFixture, OperationsDbContext>> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; public MaximumOperationsPerRequestTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) - : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ModelStateValidation/AtomicModelStateValidationTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ModelStateValidation/AtomicModelStateValidationTests.cs index ac16b2f778..ef00ded3a8 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ModelStateValidation/AtomicModelStateValidationTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ModelStateValidation/AtomicModelStateValidationTests.cs @@ -11,13 +11,13 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.ModelStateValidation { - public sealed class AtomicModelStateValidationTests : IntegrationTestCollection, OperationsDbContext> + public sealed class AtomicModelStateValidationTests + : IClassFixture, OperationsDbContext>> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); public AtomicModelStateValidationTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) - : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/QueryStrings/AtomicQueryStringTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/QueryStrings/AtomicQueryStringTests.cs index b5f67c8c37..502e090e26 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/QueryStrings/AtomicQueryStringTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/QueryStrings/AtomicQueryStringTests.cs @@ -17,7 +17,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.QueryStrings { - public sealed class AtomicQueryStringTests : IntegrationTestCollection, OperationsDbContext> + public sealed class AtomicQueryStringTests : IClassFixture, OperationsDbContext>> { private static readonly DateTime FrozenTime = 30.July(2018).At(13, 46, 12); @@ -25,11 +25,11 @@ public sealed class AtomicQueryStringTests : IntegrationTestCollection, OperationsDbContext> testContext) - : base(testContext) { _testContext = testContext; testContext.AddController(); + testContext.AddController(); testContext.ConfigureServicesAfterStartup(services => { diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ResourceDefinitions/AtomicSparseFieldSetResourceDefinitionTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ResourceDefinitions/AtomicSparseFieldSetResourceDefinitionTests.cs index 8b56e3eb03..1c485fd462 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ResourceDefinitions/AtomicSparseFieldSetResourceDefinitionTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ResourceDefinitions/AtomicSparseFieldSetResourceDefinitionTests.cs @@ -13,13 +13,13 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.ResourceDefinitions { - public sealed class AtomicSparseFieldSetResourceDefinitionTests : IntegrationTestCollection, OperationsDbContext> + public sealed class AtomicSparseFieldSetResourceDefinitionTests + : IClassFixture, OperationsDbContext>> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); public AtomicSparseFieldSetResourceDefinitionTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) - : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicRollbackTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicRollbackTests.cs index e395200e51..6d60e98ee6 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicRollbackTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicRollbackTests.cs @@ -13,13 +13,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Transactions { - public sealed class AtomicRollbackTests : IntegrationTestCollection, OperationsDbContext> + public sealed class AtomicRollbackTests : IClassFixture, OperationsDbContext>> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); public AtomicRollbackTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) - : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicTransactionConsistencyTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicTransactionConsistencyTests.cs index 6b8623e3df..d8fbec31a6 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicTransactionConsistencyTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicTransactionConsistencyTests.cs @@ -14,12 +14,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Transactions { - public sealed class AtomicTransactionConsistencyTests : IntegrationTestCollection, OperationsDbContext> + public sealed class AtomicTransactionConsistencyTests + : IClassFixture, OperationsDbContext>> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; public AtomicTransactionConsistencyTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) - : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicAddToToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicAddToToManyRelationshipTests.cs index feb5f364c5..14c8a312b4 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicAddToToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicAddToToManyRelationshipTests.cs @@ -14,13 +14,13 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Updating.Relationships { - public sealed class AtomicAddToToManyRelationshipTests : IntegrationTestCollection, OperationsDbContext> + public sealed class AtomicAddToToManyRelationshipTests + : IClassFixture, OperationsDbContext>> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); public AtomicAddToToManyRelationshipTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) - : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicRemoveFromToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicRemoveFromToManyRelationshipTests.cs index e8908e405e..c13e5a8b4b 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicRemoveFromToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicRemoveFromToManyRelationshipTests.cs @@ -14,13 +14,13 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Updating.Relationships { - public sealed class AtomicRemoveFromToManyRelationshipTests : IntegrationTestCollection, OperationsDbContext> + public sealed class AtomicRemoveFromToManyRelationshipTests + : IClassFixture, OperationsDbContext>> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); public AtomicRemoveFromToManyRelationshipTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) - : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicReplaceToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicReplaceToManyRelationshipTests.cs index 2b436670d0..6203026fd7 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicReplaceToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicReplaceToManyRelationshipTests.cs @@ -14,13 +14,13 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Updating.Relationships { - public sealed class AtomicReplaceToManyRelationshipTests : IntegrationTestCollection, OperationsDbContext> + public sealed class AtomicReplaceToManyRelationshipTests + : IClassFixture, OperationsDbContext>> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); public AtomicReplaceToManyRelationshipTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) - : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicUpdateToOneRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicUpdateToOneRelationshipTests.cs index eec414fe1a..142b2985a7 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicUpdateToOneRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicUpdateToOneRelationshipTests.cs @@ -13,13 +13,13 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Updating.Relationships { - public sealed class AtomicUpdateToOneRelationshipTests : IntegrationTestCollection, OperationsDbContext> + public sealed class AtomicUpdateToOneRelationshipTests + : IClassFixture, OperationsDbContext>> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); public AtomicUpdateToOneRelationshipTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) - : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicReplaceToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicReplaceToManyRelationshipTests.cs index 7d6392728c..32458a9253 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicReplaceToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicReplaceToManyRelationshipTests.cs @@ -14,13 +14,13 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Updating.Resources { - public sealed class AtomicReplaceToManyRelationshipTests : IntegrationTestCollection, OperationsDbContext> + public sealed class AtomicReplaceToManyRelationshipTests + : IClassFixture, OperationsDbContext>> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); public AtomicReplaceToManyRelationshipTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) - : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateResourceTests.cs index e3ae498621..76af5653f5 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateResourceTests.cs @@ -15,13 +15,12 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Updating.Resources { - public sealed class AtomicUpdateResourceTests : IntegrationTestCollection, OperationsDbContext> + public sealed class AtomicUpdateResourceTests : IClassFixture, OperationsDbContext>> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); public AtomicUpdateResourceTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) - : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateToOneRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateToOneRelationshipTests.cs index 3022097f08..d8f7f1eaa9 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateToOneRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateToOneRelationshipTests.cs @@ -13,13 +13,13 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.AtomicOperations.Updating.Resources { - public sealed class AtomicUpdateToOneRelationshipTests : IntegrationTestCollection, OperationsDbContext> + public sealed class AtomicUpdateToOneRelationshipTests + : IClassFixture, OperationsDbContext>> { private readonly ExampleIntegrationTestContext, OperationsDbContext> _testContext; private readonly OperationsFakers _fakers = new OperationsFakers(); public AtomicUpdateToOneRelationshipTests(ExampleIntegrationTestContext, OperationsDbContext> testContext) - : base(testContext) { _testContext = testContext; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CompositeKeys/CompositeKeyTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CompositeKeys/CompositeKeyTests.cs index fcc27986eb..7ac010ac31 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CompositeKeys/CompositeKeyTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CompositeKeys/CompositeKeyTests.cs @@ -14,15 +14,18 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.CompositeKeys { - public sealed class CompositeKeyTests : IntegrationTestCollection, CompositeDbContext> + public sealed class CompositeKeyTests : IClassFixture, CompositeDbContext>> { private readonly ExampleIntegrationTestContext, CompositeDbContext> _testContext; public CompositeKeyTests(ExampleIntegrationTestContext, CompositeDbContext> testContext) - : base(testContext) { _testContext = testContext; + testContext.AddController(); + testContext.AddController(); + testContext.AddController(); + testContext.ConfigureServicesAfterStartup(services => { services.AddResourceRepository(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/AcceptHeaderTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/AcceptHeaderTests.cs index 0fbb8081c8..d85b6af081 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/AcceptHeaderTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/AcceptHeaderTests.cs @@ -12,16 +12,16 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation { - public sealed class AcceptHeaderTests : IntegrationTestCollection, PolicyDbContext> + public sealed class AcceptHeaderTests : IClassFixture, PolicyDbContext>> { private readonly ExampleIntegrationTestContext, PolicyDbContext> _testContext; public AcceptHeaderTests(ExampleIntegrationTestContext, PolicyDbContext> testContext) - : base(testContext) { _testContext = testContext; testContext.AddController(); + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/ContentTypeHeaderTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/ContentTypeHeaderTests.cs index 5eb4bd46b9..60f92a02e2 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/ContentTypeHeaderTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/ContentTypeHeaderTests.cs @@ -11,15 +11,15 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ContentNegotiation { - public sealed class ContentTypeHeaderTests : IntegrationTestCollection, PolicyDbContext> + public sealed class ContentTypeHeaderTests : IClassFixture, PolicyDbContext>> { private readonly ExampleIntegrationTestContext, PolicyDbContext> _testContext; public ContentTypeHeaderTests(ExampleIntegrationTestContext, PolicyDbContext> testContext) - : base(testContext) { _testContext = testContext; + testContext.AddController(); testContext.AddController(); } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ControllerActionResults/ActionResultTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ControllerActionResults/ActionResultTests.cs index 0957abba1e..004471f2ef 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ControllerActionResults/ActionResultTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ControllerActionResults/ActionResultTests.cs @@ -9,14 +9,15 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ControllerActionResults { - public sealed class ActionResultTests : IntegrationTestCollection, ActionResultDbContext> + public sealed class ActionResultTests : IClassFixture, ActionResultDbContext>> { private readonly ExampleIntegrationTestContext, ActionResultDbContext> _testContext; public ActionResultTests(ExampleIntegrationTestContext, ActionResultDbContext> testContext) - : base(testContext) { _testContext = testContext; + + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/ApiControllerAttributeTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/ApiControllerAttributeTests.cs index 01f2b54996..270d659c2f 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/ApiControllerAttributeTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/ApiControllerAttributeTests.cs @@ -9,14 +9,15 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.CustomRoutes { - public sealed class ApiControllerAttributeTests : IntegrationTestCollection, CustomRouteDbContext> + public sealed class ApiControllerAttributeTests : IClassFixture, CustomRouteDbContext>> { private readonly ExampleIntegrationTestContext, CustomRouteDbContext> _testContext; public ApiControllerAttributeTests(ExampleIntegrationTestContext, CustomRouteDbContext> testContext) - : base(testContext) { _testContext = testContext; + + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/CustomRouteTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/CustomRouteTests.cs index 9fa9af6257..3eaa81e63b 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/CustomRouteTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/CustomRouteTests.cs @@ -11,7 +11,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.CustomRoutes { - public sealed class CustomRouteTests : IntegrationTestCollection, CustomRouteDbContext> + public sealed class CustomRouteTests : IClassFixture, CustomRouteDbContext>> { private const string HostPrefix = "http://localhost"; @@ -19,9 +19,11 @@ public sealed class CustomRouteTests : IntegrationTestCollection, CustomRouteDbContext> testContext) - : base(testContext) { _testContext = testContext; + + testContext.AddController(); + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/EagerLoading/EagerLoadingTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/EagerLoading/EagerLoadingTests.cs index af058aae68..baa7ecc702 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/EagerLoading/EagerLoadingTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/EagerLoading/EagerLoadingTests.cs @@ -11,16 +11,19 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.EagerLoading { - public sealed class EagerLoadingTests : IntegrationTestCollection, EagerLoadingDbContext> + public sealed class EagerLoadingTests : IClassFixture, EagerLoadingDbContext>> { private readonly ExampleIntegrationTestContext, EagerLoadingDbContext> _testContext; private readonly EagerLoadingFakers _fakers = new EagerLoadingFakers(); public EagerLoadingTests(ExampleIntegrationTestContext, EagerLoadingDbContext> testContext) - : base(testContext) { _testContext = testContext; + testContext.AddController(); + testContext.AddController(); + testContext.AddController(); + testContext.ConfigureServicesAfterStartup(services => { services.AddResourceRepository(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ExceptionHandling/ExceptionHandlerTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ExceptionHandling/ExceptionHandlerTests.cs index 410b642d07..a14d5fcdcc 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ExceptionHandling/ExceptionHandlerTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ExceptionHandling/ExceptionHandlerTests.cs @@ -16,15 +16,17 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ExceptionHandling { - public sealed class ExceptionHandlerTests : IntegrationTestCollection, ErrorDbContext> + public sealed class ExceptionHandlerTests : IClassFixture, ErrorDbContext>> { private readonly ExampleIntegrationTestContext, ErrorDbContext> _testContext; public ExceptionHandlerTests(ExampleIntegrationTestContext, ErrorDbContext> testContext) - : base(testContext) { _testContext = testContext; + testContext.AddController(); + testContext.AddController(); + FakeLoggerFactory loggerFactory = null; testContext.ConfigureLogging(options => diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/HostingInIIS/HostingTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/HostingInIIS/HostingTests.cs index 8aa6385297..b881952cc7 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/HostingInIIS/HostingTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/HostingInIIS/HostingTests.cs @@ -9,7 +9,7 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.HostingInIIS { - public sealed class HostingTests : IntegrationTestCollection, HostingDbContext> + public sealed class HostingTests : IClassFixture, HostingDbContext>> { private const string HostPrefix = "http://localhost"; @@ -17,9 +17,11 @@ public sealed class HostingTests : IntegrationTestCollection, HostingDbContext> testContext) - : base(testContext) { _testContext = testContext; + + testContext.AddController(); + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/IdObfuscation/IdObfuscationTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/IdObfuscation/IdObfuscationTests.cs index cfe66e6170..bb40ab31d3 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/IdObfuscation/IdObfuscationTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/IdObfuscation/IdObfuscationTests.cs @@ -11,15 +11,17 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.IdObfuscation { - public sealed class IdObfuscationTests : IntegrationTestCollection, ObfuscationDbContext> + public sealed class IdObfuscationTests : IClassFixture, ObfuscationDbContext>> { private readonly ExampleIntegrationTestContext, ObfuscationDbContext> _testContext; private readonly ObfuscationFakers _fakers = new ObfuscationFakers(); public IdObfuscationTests(ExampleIntegrationTestContext, ObfuscationDbContext> testContext) - : base(testContext) { _testContext = testContext; + + testContext.AddController(); + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithNamespaceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithNamespaceTests.cs index 452124c865..771cadd75c 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithNamespaceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithNamespaceTests.cs @@ -13,7 +13,8 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Links { - public sealed class AbsoluteLinksWithNamespaceTests : IntegrationTestCollection, LinksDbContext> + public sealed class AbsoluteLinksWithNamespaceTests + : IClassFixture, LinksDbContext>> { private const string HostPrefix = "http://localhost"; @@ -21,10 +22,12 @@ public sealed class AbsoluteLinksWithNamespaceTests : IntegrationTestCollection< private readonly LinksFakers _fakers = new LinksFakers(); public AbsoluteLinksWithNamespaceTests(ExampleIntegrationTestContext, LinksDbContext> testContext) - : base(testContext) { _testContext = testContext; + testContext.AddController(); + testContext.AddController(); + testContext.ConfigureServicesAfterStartup(services => { services.AddScoped(typeof(IResourceChangeTracker<>), typeof(NeverSameResourceChangeTracker<>)); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithoutNamespaceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithoutNamespaceTests.cs index f3bae4e119..53cfa4d1d5 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithoutNamespaceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithoutNamespaceTests.cs @@ -13,7 +13,8 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Links { - public sealed class AbsoluteLinksWithoutNamespaceTests : IntegrationTestCollection, LinksDbContext> + public sealed class AbsoluteLinksWithoutNamespaceTests + : IClassFixture, LinksDbContext>> { private const string HostPrefix = "http://localhost"; @@ -21,10 +22,12 @@ public sealed class AbsoluteLinksWithoutNamespaceTests : IntegrationTestCollecti private readonly LinksFakers _fakers = new LinksFakers(); public AbsoluteLinksWithoutNamespaceTests(ExampleIntegrationTestContext, LinksDbContext> testContext) - : base(testContext) { _testContext = testContext; + testContext.AddController(); + testContext.AddController(); + testContext.ConfigureServicesAfterStartup(services => { services.AddScoped(typeof(IResourceChangeTracker<>), typeof(NeverSameResourceChangeTracker<>)); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/LinkInclusionTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/LinkInclusionTests.cs index 3c6bab8ad4..e438b5bc9d 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/LinkInclusionTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/LinkInclusionTests.cs @@ -9,15 +9,16 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Links { - public sealed class LinkInclusionTests : IntegrationTestCollection, LinksDbContext> + public sealed class LinkInclusionTests : IClassFixture, LinksDbContext>> { private readonly ExampleIntegrationTestContext, LinksDbContext> _testContext; private readonly LinksFakers _fakers = new LinksFakers(); public LinkInclusionTests(ExampleIntegrationTestContext, LinksDbContext> testContext) - : base(testContext) { _testContext = testContext; + + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithNamespaceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithNamespaceTests.cs index 20a86ab46b..9102bc7210 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithNamespaceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithNamespaceTests.cs @@ -13,16 +13,19 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Links { - public sealed class RelativeLinksWithNamespaceTests : IntegrationTestCollection, LinksDbContext> + public sealed class RelativeLinksWithNamespaceTests + : IClassFixture, LinksDbContext>> { private readonly ExampleIntegrationTestContext, LinksDbContext> _testContext; private readonly LinksFakers _fakers = new LinksFakers(); public RelativeLinksWithNamespaceTests(ExampleIntegrationTestContext, LinksDbContext> testContext) - : base(testContext) { _testContext = testContext; + testContext.AddController(); + testContext.AddController(); + testContext.ConfigureServicesAfterStartup(services => { services.AddScoped(typeof(IResourceChangeTracker<>), typeof(NeverSameResourceChangeTracker<>)); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithoutNamespaceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithoutNamespaceTests.cs index f6cc3d0940..6df8b19792 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithoutNamespaceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithoutNamespaceTests.cs @@ -13,16 +13,19 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Links { - public sealed class RelativeLinksWithoutNamespaceTests : IntegrationTestCollection, LinksDbContext> + public sealed class RelativeLinksWithoutNamespaceTests + : IClassFixture, LinksDbContext>> { private readonly ExampleIntegrationTestContext, LinksDbContext> _testContext; private readonly LinksFakers _fakers = new LinksFakers(); public RelativeLinksWithoutNamespaceTests(ExampleIntegrationTestContext, LinksDbContext> testContext) - : base(testContext) { _testContext = testContext; + testContext.AddController(); + testContext.AddController(); + testContext.ConfigureServicesAfterStartup(services => { services.AddScoped(typeof(IResourceChangeTracker<>), typeof(NeverSameResourceChangeTracker<>)); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Logging/LoggingTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Logging/LoggingTests.cs index e8f5ab26d0..3810879d29 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Logging/LoggingTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Logging/LoggingTests.cs @@ -11,16 +11,17 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Logging { - public sealed class LoggingTests : IntegrationTestCollection, AuditDbContext> + public sealed class LoggingTests : IClassFixture, AuditDbContext>> { private readonly ExampleIntegrationTestContext, AuditDbContext> _testContext; private readonly AuditFakers _fakers = new AuditFakers(); public LoggingTests(ExampleIntegrationTestContext, AuditDbContext> testContext) - : base(testContext) { _testContext = testContext; + testContext.AddController(); + FakeLoggerFactory loggerFactory = null; testContext.ConfigureLogging(options => diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResourceMetaTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResourceMetaTests.cs index 08862b8d29..f909a48fcf 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResourceMetaTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResourceMetaTests.cs @@ -12,16 +12,18 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Meta { - public sealed class ResourceMetaTests : IntegrationTestCollection, SupportDbContext> + public sealed class ResourceMetaTests : IClassFixture, SupportDbContext>> { private readonly ExampleIntegrationTestContext, SupportDbContext> _testContext; private readonly SupportFakers _fakers = new SupportFakers(); public ResourceMetaTests(ExampleIntegrationTestContext, SupportDbContext> testContext) - : base(testContext) { _testContext = testContext; + testContext.AddController(); + testContext.AddController(); + testContext.ConfigureServicesAfterStartup(services => { services.AddScoped, SupportTicketDefinition>(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResponseMetaTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResponseMetaTests.cs index c52f336062..c45b76a5f3 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResponseMetaTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResponseMetaTests.cs @@ -11,15 +11,17 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Meta { - public sealed class ResponseMetaTests : IntegrationTestCollection, SupportDbContext> + public sealed class ResponseMetaTests : IClassFixture, SupportDbContext>> { private readonly ExampleIntegrationTestContext, SupportDbContext> _testContext; public ResponseMetaTests(ExampleIntegrationTestContext, SupportDbContext> testContext) - : base(testContext) { _testContext = testContext; + testContext.AddController(); + testContext.AddController(); + testContext.ConfigureServicesAfterStartup(services => { services.AddSingleton(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/TopLevelCountTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/TopLevelCountTests.cs index bb1cb59817..dfb8fc60ee 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/TopLevelCountTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/TopLevelCountTests.cs @@ -12,16 +12,18 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Meta { - public sealed class TopLevelCountTests : IntegrationTestCollection, SupportDbContext> + public sealed class TopLevelCountTests : IClassFixture, SupportDbContext>> { private readonly ExampleIntegrationTestContext, SupportDbContext> _testContext; private readonly SupportFakers _fakers = new SupportFakers(); public TopLevelCountTests(ExampleIntegrationTestContext, SupportDbContext> testContext) - : base(testContext) { _testContext = testContext; + testContext.AddController(); + testContext.AddController(); + testContext.ConfigureServicesAfterStartup(services => { services.AddScoped(typeof(IResourceChangeTracker<>), typeof(NeverSameResourceChangeTracker<>)); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/ModelStateValidationTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/ModelStateValidationTests.cs index c8f17dd1ab..ca4499aefc 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/ModelStateValidationTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/ModelStateValidationTests.cs @@ -10,14 +10,17 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ModelStateValidation { - public sealed class ModelStateValidationTests : IntegrationTestCollection, ModelStateDbContext> + public sealed class ModelStateValidationTests + : IClassFixture, ModelStateDbContext>> { private readonly ExampleIntegrationTestContext, ModelStateDbContext> _testContext; public ModelStateValidationTests(ExampleIntegrationTestContext, ModelStateDbContext> testContext) - : base(testContext) { _testContext = testContext; + + testContext.AddController(); + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/NoModelStateValidationTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/NoModelStateValidationTests.cs index 6253e671af..20c6a884d9 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/NoModelStateValidationTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/NoModelStateValidationTests.cs @@ -9,14 +9,16 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ModelStateValidation { - public sealed class NoModelStateValidationTests : IntegrationTestCollection, ModelStateDbContext> + public sealed class NoModelStateValidationTests : IClassFixture, ModelStateDbContext>> { private readonly ExampleIntegrationTestContext, ModelStateDbContext> _testContext; public NoModelStateValidationTests(ExampleIntegrationTestContext, ModelStateDbContext> testContext) - : base(testContext) { _testContext = testContext; + + testContext.AddController(); + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NamingConventions/KebabCasingTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NamingConventions/KebabCasingTests.cs index 238ae12385..b03ce53843 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NamingConventions/KebabCasingTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NamingConventions/KebabCasingTests.cs @@ -9,15 +9,17 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.NamingConventions { - public sealed class KebabCasingTests : IntegrationTestCollection, SwimmingDbContext> + public sealed class KebabCasingTests : IClassFixture, SwimmingDbContext>> { private readonly ExampleIntegrationTestContext, SwimmingDbContext> _testContext; private readonly SwimmingFakers _fakers = new SwimmingFakers(); public KebabCasingTests(ExampleIntegrationTestContext, SwimmingDbContext> testContext) - : base(testContext) { _testContext = testContext; + + testContext.AddController(); + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NonJsonApiControllers/NonJsonApiControllerTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NonJsonApiControllers/NonJsonApiControllerTests.cs index 8377ffadef..19934d7fc3 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NonJsonApiControllers/NonJsonApiControllerTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NonJsonApiControllers/NonJsonApiControllerTests.cs @@ -4,20 +4,19 @@ using System.Threading.Tasks; using FluentAssertions; using JsonApiDotNetCoreExample.Startups; +using Microsoft.AspNetCore.Mvc.Testing; using TestBuildingBlocks; using Xunit; namespace JsonApiDotNetCoreExampleTests.IntegrationTests.NonJsonApiControllers { - public sealed class NonJsonApiControllerTests : IClassFixture> + public sealed class NonJsonApiControllerTests : IClassFixture> { - private readonly ExampleIntegrationTestContext _testContext; + private readonly WebApplicationFactory _factory; - public NonJsonApiControllerTests(ExampleIntegrationTestContext testContext) + public NonJsonApiControllerTests(WebApplicationFactory factory) { - _testContext = testContext; - - testContext.AddController(); + _factory = factory; } [Fact] @@ -26,7 +25,7 @@ public async Task Get_skips_middleware_and_formatters() // Arrange using var request = new HttpRequestMessage(HttpMethod.Get, "/NonJsonApi"); - HttpClient client = _testContext.Factory.CreateClient(); + HttpClient client = _factory.CreateClient(); // Act HttpResponseMessage httpResponse = await client.SendAsync(request); @@ -54,7 +53,7 @@ public async Task Post_skips_middleware_and_formatters() } }; - HttpClient client = _testContext.Factory.CreateClient(); + HttpClient client = _factory.CreateClient(); // Act HttpResponseMessage httpResponse = await client.SendAsync(request); @@ -73,7 +72,7 @@ public async Task Post_skips_error_handler() // Arrange using var request = new HttpRequestMessage(HttpMethod.Post, "/NonJsonApi"); - HttpClient client = _testContext.Factory.CreateClient(); + HttpClient client = _factory.CreateClient(); // Act HttpResponseMessage httpResponse = await client.SendAsync(request); @@ -101,7 +100,7 @@ public async Task Put_skips_middleware_and_formatters() } }; - HttpClient client = _testContext.Factory.CreateClient(); + HttpClient client = _factory.CreateClient(); // Act HttpResponseMessage httpResponse = await client.SendAsync(request); @@ -120,7 +119,7 @@ public async Task Patch_skips_middleware_and_formatters() // Arrange using var request = new HttpRequestMessage(HttpMethod.Patch, "/NonJsonApi?name=Janice"); - HttpClient client = _testContext.Factory.CreateClient(); + HttpClient client = _factory.CreateClient(); // Act HttpResponseMessage httpResponse = await client.SendAsync(request); @@ -139,7 +138,7 @@ public async Task Delete_skips_middleware_and_formatters() // Arrange using var request = new HttpRequestMessage(HttpMethod.Delete, "/NonJsonApi"); - HttpClient client = _testContext.Factory.CreateClient(); + HttpClient client = _factory.CreateClient(); // Act HttpResponseMessage httpResponse = await client.SendAsync(request); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDataTypeTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDataTypeTests.cs index ff7f5a26e2..6858c65587 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDataTypeTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDataTypeTests.cs @@ -16,15 +16,16 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.Filtering { - public sealed class FilterDataTypeTests : IntegrationTestCollection, FilterDbContext> + public sealed class FilterDataTypeTests : IClassFixture, FilterDbContext>> { private readonly ExampleIntegrationTestContext, FilterDbContext> _testContext; public FilterDataTypeTests(ExampleIntegrationTestContext, FilterDbContext> testContext) - : base(testContext) { _testContext = testContext; + testContext.AddController(); + var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService(); options.EnableLegacyFilterNotation = false; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDepthTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDepthTests.cs index 05642164af..105b5e80d0 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDepthTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDepthTests.cs @@ -14,16 +14,18 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.Filtering { - public sealed class FilterDepthTests : IntegrationTestCollection, QueryStringDbContext> + public sealed class FilterDepthTests : IClassFixture, QueryStringDbContext>> { private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; private readonly QueryStringFakers _fakers = new QueryStringFakers(); public FilterDepthTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) - : base(testContext) { _testContext = testContext; + testContext.AddController(); + testContext.AddController(); + var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService(); options.EnableLegacyFilterNotation = false; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterOperatorTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterOperatorTests.cs index c7a64575e5..c198d6253f 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterOperatorTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterOperatorTests.cs @@ -16,15 +16,16 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.Filtering { - public sealed class FilterOperatorTests : IntegrationTestCollection, FilterDbContext> + public sealed class FilterOperatorTests : IClassFixture, FilterDbContext>> { private readonly ExampleIntegrationTestContext, FilterDbContext> _testContext; public FilterOperatorTests(ExampleIntegrationTestContext, FilterDbContext> testContext) - : base(testContext) { _testContext = testContext; + testContext.AddController(); + var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService(); options.EnableLegacyFilterNotation = false; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterTests.cs index ae504ad915..61c8cf64cd 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterTests.cs @@ -12,16 +12,17 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.Filtering { - public sealed class FilterTests : IntegrationTestCollection, QueryStringDbContext> + public sealed class FilterTests : IClassFixture, QueryStringDbContext>> { private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; private readonly QueryStringFakers _fakers = new QueryStringFakers(); public FilterTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) - : base(testContext) { _testContext = testContext; + testContext.AddController(); + var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService(); options.EnableLegacyFilterNotation = false; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Includes/IncludeTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Includes/IncludeTests.cs index 3e56c4fd17..dd2661ad92 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Includes/IncludeTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Includes/IncludeTests.cs @@ -13,16 +13,20 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.Includes { - public sealed class IncludeTests : IntegrationTestCollection, QueryStringDbContext> + public sealed class IncludeTests : IClassFixture, QueryStringDbContext>> { private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; private readonly QueryStringFakers _fakers = new QueryStringFakers(); public IncludeTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) - : base(testContext) { _testContext = testContext; + testContext.AddController(); + testContext.AddController(); + testContext.AddController(); + testContext.AddController(); + var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService(); options.MaximumIncludeDepth = null; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithTotalCountTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithTotalCountTests.cs index d012313ed8..c358b767a4 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithTotalCountTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithTotalCountTests.cs @@ -13,7 +13,8 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.Pagination { - public sealed class PaginationWithTotalCountTests : IntegrationTestCollection, QueryStringDbContext> + public sealed class PaginationWithTotalCountTests + : IClassFixture, QueryStringDbContext>> { private const string HostPrefix = "http://localhost"; private const int DefaultPageSize = 5; @@ -22,10 +23,13 @@ public sealed class PaginationWithTotalCountTests : IntegrationTestCollection, QueryStringDbContext> testContext) - : base(testContext) { _testContext = testContext; + testContext.AddController(); + testContext.AddController(); + testContext.AddController(); + var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService(); options.IncludeTotalResourceCount = true; options.DefaultPageSize = new PageSize(DefaultPageSize); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithoutTotalCountTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithoutTotalCountTests.cs index dd2babc233..897aeb5b3b 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithoutTotalCountTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithoutTotalCountTests.cs @@ -12,7 +12,8 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.Pagination { - public sealed class PaginationWithoutTotalCountTests : IntegrationTestCollection, QueryStringDbContext> + public sealed class PaginationWithoutTotalCountTests + : IClassFixture, QueryStringDbContext>> { private const string HostPrefix = "http://localhost"; private const int DefaultPageSize = 5; @@ -21,10 +22,12 @@ public sealed class PaginationWithoutTotalCountTests : IntegrationTestCollection private readonly QueryStringFakers _fakers = new QueryStringFakers(); public PaginationWithoutTotalCountTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) - : base(testContext) { _testContext = testContext; + testContext.AddController(); + testContext.AddController(); + var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService(); options.IncludeTotalResourceCount = false; options.DefaultPageSize = new PageSize(DefaultPageSize); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationTests.cs index 903b5c3f42..5c91afed80 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationTests.cs @@ -12,17 +12,18 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.Pagination { - public sealed class RangeValidationTests : IntegrationTestCollection, QueryStringDbContext> + public sealed class RangeValidationTests : IClassFixture, QueryStringDbContext>> { private const int DefaultPageSize = 5; private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; private readonly QueryStringFakers _fakers = new QueryStringFakers(); public RangeValidationTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) - : base(testContext) { _testContext = testContext; + testContext.AddController(); + var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService(); options.DefaultPageSize = new PageSize(DefaultPageSize); options.MaximumPageSize = null; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationWithMaximumTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationWithMaximumTests.cs index b95c3bdf0f..f1ac1ffd4c 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationWithMaximumTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationWithMaximumTests.cs @@ -11,17 +11,19 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.Pagination { - public sealed class RangeValidationWithMaximumTests : IntegrationTestCollection, QueryStringDbContext> + public sealed class RangeValidationWithMaximumTests + : IClassFixture, QueryStringDbContext>> { private const int MaximumPageSize = 15; private const int MaximumPageNumber = 20; private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; public RangeValidationWithMaximumTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) - : base(testContext) { _testContext = testContext; + testContext.AddController(); + var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService(); options.DefaultPageSize = new PageSize(5); options.MaximumPageSize = new PageSize(MaximumPageSize); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/QueryStringTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/QueryStringTests.cs index 9c0af99c51..ba4ef2e697 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/QueryStringTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/QueryStringTests.cs @@ -11,14 +11,15 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings { - public sealed class QueryStringTests : IntegrationTestCollection, QueryStringDbContext> + public sealed class QueryStringTests : IClassFixture, QueryStringDbContext>> { private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; public QueryStringTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) - : base(testContext) { _testContext = testContext; + + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerDefaultValueHandlingTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerDefaultValueHandlingTests.cs index 5e35f1d05d..25fb8cc0b2 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerDefaultValueHandlingTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerDefaultValueHandlingTests.cs @@ -13,15 +13,17 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings { - public sealed class SerializerDefaultValueHandlingTests : IntegrationTestCollection, QueryStringDbContext> + public sealed class SerializerDefaultValueHandlingTests + : IClassFixture, QueryStringDbContext>> { private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; private readonly QueryStringFakers _fakers = new QueryStringFakers(); public SerializerDefaultValueHandlingTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) - : base(testContext) { _testContext = testContext; + + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerNullValueHandlingTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerNullValueHandlingTests.cs index 02d50b97b8..9afd76ac62 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerNullValueHandlingTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerNullValueHandlingTests.cs @@ -13,15 +13,17 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings { - public sealed class SerializerNullValueHandlingTests : IntegrationTestCollection, QueryStringDbContext> + public sealed class SerializerNullValueHandlingTests + : IClassFixture, QueryStringDbContext>> { private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; private readonly QueryStringFakers _fakers = new QueryStringFakers(); public SerializerNullValueHandlingTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) - : base(testContext) { _testContext = testContext; + + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Sorting/SortTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Sorting/SortTests.cs index 82e02a9948..c9716739e6 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Sorting/SortTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Sorting/SortTests.cs @@ -12,15 +12,18 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.Sorting { - public sealed class SortTests : IntegrationTestCollection, QueryStringDbContext> + public sealed class SortTests : IClassFixture, QueryStringDbContext>> { private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; private readonly QueryStringFakers _fakers = new QueryStringFakers(); public SortTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) - : base(testContext) { _testContext = testContext; + + testContext.AddController(); + testContext.AddController(); + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SparseFieldSets/SparseFieldSetTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SparseFieldSets/SparseFieldSetTests.cs index d1f885fbc8..ad8563cc1a 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SparseFieldSets/SparseFieldSetTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SparseFieldSets/SparseFieldSetTests.cs @@ -13,16 +13,19 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.QueryStrings.SparseFieldSets { - public sealed class SparseFieldSetTests : IntegrationTestCollection, QueryStringDbContext> + public sealed class SparseFieldSetTests : IClassFixture, QueryStringDbContext>> { private readonly ExampleIntegrationTestContext, QueryStringDbContext> _testContext; private readonly QueryStringFakers _fakers = new QueryStringFakers(); public SparseFieldSetTests(ExampleIntegrationTestContext, QueryStringDbContext> testContext) - : base(testContext) { _testContext = testContext; + testContext.AddController(); + testContext.AddController(); + testContext.AddController(); + testContext.ConfigureServicesAfterStartup(services => { services.AddSingleton(); @@ -144,21 +147,22 @@ await _testContext.RunOnDatabaseAsync(async dbContext => } [Fact] - public async Task Can_select_fields_in_primary_resource_by_ID() + public async Task Can_select_fields_in_secondary_resources() { // Arrange var store = _testContext.Factory.Services.GetRequiredService(); store.Clear(); - BlogPost post = _fakers.BlogPost.Generate(); + Blog blog = _fakers.Blog.Generate(); + blog.Posts = _fakers.BlogPost.Generate(1); await _testContext.RunOnDatabaseAsync(async dbContext => { - dbContext.Posts.Add(post); + dbContext.Blogs.Add(blog); await dbContext.SaveChangesAsync(); }); - string route = $"/blogPosts/{post.StringId}?fields[blogPosts]=url,author"; + string route = $"/blogs/{blog.StringId}/posts?fields[blogPosts]=caption,labels"; // Act (HttpResponseMessage httpResponse, Document responseDocument) = await _testContext.ExecuteGetAsync(route); @@ -166,37 +170,40 @@ await _testContext.RunOnDatabaseAsync(async dbContext => // Assert httpResponse.Should().HaveStatusCode(HttpStatusCode.OK); - responseDocument.SingleData.Should().NotBeNull(); - responseDocument.SingleData.Id.Should().Be(post.StringId); - responseDocument.SingleData.Attributes.Should().HaveCount(1); - responseDocument.SingleData.Attributes["url"].Should().Be(post.Url); - responseDocument.SingleData.Relationships.Should().HaveCount(1); - responseDocument.SingleData.Relationships["author"].Data.Should().BeNull(); - responseDocument.SingleData.Relationships["author"].Links.Self.Should().NotBeNull(); - responseDocument.SingleData.Relationships["author"].Links.Related.Should().NotBeNull(); + responseDocument.ManyData.Should().HaveCount(1); + responseDocument.ManyData[0].Id.Should().Be(blog.Posts[0].StringId); + responseDocument.ManyData[0].Attributes.Should().HaveCount(1); + responseDocument.ManyData[0].Attributes["caption"].Should().Be(blog.Posts[0].Caption); + responseDocument.ManyData[0].Relationships.Should().HaveCount(1); + responseDocument.ManyData[0].Relationships["labels"].Data.Should().BeNull(); + responseDocument.ManyData[0].Relationships["labels"].Links.Self.Should().NotBeNull(); + responseDocument.ManyData[0].Relationships["labels"].Links.Related.Should().NotBeNull(); - var postCaptured = (BlogPost)store.Resources.Should().ContainSingle(resource => resource is BlogPost).And.Subject.Single(); - postCaptured.Url.Should().Be(post.Url); - postCaptured.Caption.Should().BeNull(); + var blogCaptured = (Blog)store.Resources.Should().ContainSingle(resource => resource is Blog).And.Subject.Single(); + blogCaptured.Id.Should().Be(blog.Id); + blogCaptured.Title.Should().BeNull(); + + blogCaptured.Posts.Should().HaveCount(1); + blogCaptured.Posts[0].Caption.Should().Be(blog.Posts[0].Caption); + blogCaptured.Posts[0].Url.Should().BeNull(); } [Fact] - public async Task Can_select_fields_in_secondary_resources() + public async Task Can_select_fields_in_primary_resource_by_ID() { // Arrange var store = _testContext.Factory.Services.GetRequiredService(); store.Clear(); - Blog blog = _fakers.Blog.Generate(); - blog.Posts = _fakers.BlogPost.Generate(1); + BlogPost post = _fakers.BlogPost.Generate(); await _testContext.RunOnDatabaseAsync(async dbContext => { - dbContext.Blogs.Add(blog); + dbContext.Posts.Add(post); await dbContext.SaveChangesAsync(); }); - string route = $"/blogs/{blog.StringId}/posts?fields[blogPosts]=caption,labels"; + string route = $"/blogPosts/{post.StringId}?fields[blogPosts]=url,author"; // Act (HttpResponseMessage httpResponse, Document responseDocument) = await _testContext.ExecuteGetAsync(route); @@ -204,22 +211,18 @@ await _testContext.RunOnDatabaseAsync(async dbContext => // Assert httpResponse.Should().HaveStatusCode(HttpStatusCode.OK); - responseDocument.ManyData.Should().HaveCount(1); - responseDocument.ManyData[0].Id.Should().Be(blog.Posts[0].StringId); - responseDocument.ManyData[0].Attributes.Should().HaveCount(1); - responseDocument.ManyData[0].Attributes["caption"].Should().Be(blog.Posts[0].Caption); - responseDocument.ManyData[0].Relationships.Should().HaveCount(1); - responseDocument.ManyData[0].Relationships["labels"].Data.Should().BeNull(); - responseDocument.ManyData[0].Relationships["labels"].Links.Self.Should().NotBeNull(); - responseDocument.ManyData[0].Relationships["labels"].Links.Related.Should().NotBeNull(); - - var blogCaptured = (Blog)store.Resources.Should().ContainSingle(resource => resource is Blog).And.Subject.Single(); - blogCaptured.Id.Should().Be(blog.Id); - blogCaptured.Title.Should().BeNull(); + responseDocument.SingleData.Should().NotBeNull(); + responseDocument.SingleData.Id.Should().Be(post.StringId); + responseDocument.SingleData.Attributes.Should().HaveCount(1); + responseDocument.SingleData.Attributes["url"].Should().Be(post.Url); + responseDocument.SingleData.Relationships.Should().HaveCount(1); + responseDocument.SingleData.Relationships["author"].Data.Should().BeNull(); + responseDocument.SingleData.Relationships["author"].Links.Self.Should().NotBeNull(); + responseDocument.SingleData.Relationships["author"].Links.Related.Should().NotBeNull(); - blogCaptured.Posts.Should().HaveCount(1); - blogCaptured.Posts[0].Caption.Should().Be(blog.Posts[0].Caption); - blogCaptured.Posts[0].Url.Should().BeNull(); + var postCaptured = (BlogPost)store.Resources.Should().ContainSingle(resource => resource is BlogPost).And.Subject.Single(); + postCaptured.Url.Should().Be(post.Url); + postCaptured.Caption.Should().BeNull(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceTests.cs index da8196dae8..c5b8ae3d13 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceTests.cs @@ -17,16 +17,20 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Creating { - public sealed class CreateResourceTests : IntegrationTestCollection, ReadWriteDbContext> + public sealed class CreateResourceTests : IClassFixture, ReadWriteDbContext>> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); public CreateResourceTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) - : base(testContext) { _testContext = testContext; + testContext.AddController(); + testContext.AddController(); + testContext.AddController(); + testContext.AddController(); + var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService(); options.UseRelativeLinks = false; options.AllowClientGeneratedIds = false; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithClientGeneratedIdTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithClientGeneratedIdTests.cs index 62158bc631..e62698b833 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithClientGeneratedIdTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithClientGeneratedIdTests.cs @@ -14,16 +14,19 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Creating { - public sealed class CreateResourceWithClientGeneratedIdTests : IntegrationTestCollection, ReadWriteDbContext> + public sealed class CreateResourceWithClientGeneratedIdTests + : IClassFixture, ReadWriteDbContext>> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); public CreateResourceWithClientGeneratedIdTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) - : base(testContext) { _testContext = testContext; + testContext.AddController(); + testContext.AddController(); + var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService(); options.AllowClientGeneratedIds = true; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToManyRelationshipTests.cs index c1cb44bdad..b5a582743c 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToManyRelationshipTests.cs @@ -12,15 +12,18 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Creating { - public sealed class CreateResourceWithToManyRelationshipTests : IntegrationTestCollection, ReadWriteDbContext> + public sealed class CreateResourceWithToManyRelationshipTests + : IClassFixture, ReadWriteDbContext>> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); public CreateResourceWithToManyRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) - : base(testContext) { _testContext = testContext; + + testContext.AddController(); + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToOneRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToOneRelationshipTests.cs index fbce50e3e5..68be82747f 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToOneRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToOneRelationshipTests.cs @@ -15,16 +15,20 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Creating { - public sealed class CreateResourceWithToOneRelationshipTests : IntegrationTestCollection, ReadWriteDbContext> + public sealed class CreateResourceWithToOneRelationshipTests + : IClassFixture, ReadWriteDbContext>> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); public CreateResourceWithToOneRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) - : base(testContext) { _testContext = testContext; + testContext.AddController(); + testContext.AddController(); + testContext.AddController(); + var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService(); options.AllowClientGeneratedIds = true; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Deleting/DeleteResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Deleting/DeleteResourceTests.cs index c668df66dd..923734b40c 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Deleting/DeleteResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Deleting/DeleteResourceTests.cs @@ -12,15 +12,18 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Deleting { - public sealed class DeleteResourceTests : IntegrationTestCollection, ReadWriteDbContext> + public sealed class DeleteResourceTests : IClassFixture, ReadWriteDbContext>> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); public DeleteResourceTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) - : base(testContext) { _testContext = testContext; + + testContext.AddController(); + testContext.AddController(); + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchRelationshipTests.cs index d3a7a68d78..c3b34fe51b 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchRelationshipTests.cs @@ -11,15 +11,17 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Fetching { - public sealed class FetchRelationshipTests : IntegrationTestCollection, ReadWriteDbContext> + public sealed class FetchRelationshipTests : IClassFixture, ReadWriteDbContext>> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); public FetchRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) - : base(testContext) { _testContext = testContext; + + testContext.AddController(); + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchResourceTests.cs index ce9492cf1f..b1e4efb30a 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchResourceTests.cs @@ -11,15 +11,17 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Fetching { - public sealed class FetchResourceTests : IntegrationTestCollection, ReadWriteDbContext> + public sealed class FetchResourceTests : IClassFixture, ReadWriteDbContext>> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); public FetchResourceTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) - : base(testContext) { _testContext = testContext; + + testContext.AddController(); + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/AddToToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/AddToToManyRelationshipTests.cs index c48401fcbb..de368c115a 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/AddToToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/AddToToManyRelationshipTests.cs @@ -12,15 +12,16 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Updating.Relationships { - public sealed class AddToToManyRelationshipTests : IntegrationTestCollection, ReadWriteDbContext> + public sealed class AddToToManyRelationshipTests : IClassFixture, ReadWriteDbContext>> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); public AddToToManyRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) - : base(testContext) { _testContext = testContext; + + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/RemoveFromToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/RemoveFromToManyRelationshipTests.cs index 1cf7590c34..63d4398850 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/RemoveFromToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/RemoveFromToManyRelationshipTests.cs @@ -12,15 +12,17 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Updating.Relationships { - public sealed class RemoveFromToManyRelationshipTests : IntegrationTestCollection, ReadWriteDbContext> + public sealed class RemoveFromToManyRelationshipTests + : IClassFixture, ReadWriteDbContext>> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); public RemoveFromToManyRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) - : base(testContext) { _testContext = testContext; + + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/ReplaceToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/ReplaceToManyRelationshipTests.cs index 0b17dc3d1f..27419742ee 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/ReplaceToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/ReplaceToManyRelationshipTests.cs @@ -12,15 +12,16 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Updating.Relationships { - public sealed class ReplaceToManyRelationshipTests : IntegrationTestCollection, ReadWriteDbContext> + public sealed class ReplaceToManyRelationshipTests : IClassFixture, ReadWriteDbContext>> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); public ReplaceToManyRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) - : base(testContext) { _testContext = testContext; + + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/UpdateToOneRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/UpdateToOneRelationshipTests.cs index d6b62e9153..64dbe765b1 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/UpdateToOneRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/UpdateToOneRelationshipTests.cs @@ -12,15 +12,18 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Updating.Relationships { - public sealed class UpdateToOneRelationshipTests : IntegrationTestCollection, ReadWriteDbContext> + public sealed class UpdateToOneRelationshipTests : IClassFixture, ReadWriteDbContext>> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); public UpdateToOneRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) - : base(testContext) { _testContext = testContext; + + testContext.AddController(); + testContext.AddController(); + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/ReplaceToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/ReplaceToManyRelationshipTests.cs index c0ef12b73d..5c367f7813 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/ReplaceToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/ReplaceToManyRelationshipTests.cs @@ -13,15 +13,16 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Updating.Resources { - public sealed class ReplaceToManyRelationshipTests : IntegrationTestCollection, ReadWriteDbContext> + public sealed class ReplaceToManyRelationshipTests : IClassFixture, ReadWriteDbContext>> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); public ReplaceToManyRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) - : base(testContext) { _testContext = testContext; + + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateResourceTests.cs index ba3df637e3..5d8dd382fa 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateResourceTests.cs @@ -15,15 +15,19 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Updating.Resources { - public sealed class UpdateResourceTests : IntegrationTestCollection, ReadWriteDbContext> + public sealed class UpdateResourceTests : IClassFixture, ReadWriteDbContext>> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); public UpdateResourceTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) - : base(testContext) { _testContext = testContext; + + testContext.AddController(); + testContext.AddController(); + testContext.AddController(); + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateToOneRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateToOneRelationshipTests.cs index 141f9924f4..4522b75a4b 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateToOneRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateToOneRelationshipTests.cs @@ -12,15 +12,18 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ReadWrite.Updating.Resources { - public sealed class UpdateToOneRelationshipTests : IntegrationTestCollection, ReadWriteDbContext> + public sealed class UpdateToOneRelationshipTests : IClassFixture, ReadWriteDbContext>> { private readonly ExampleIntegrationTestContext, ReadWriteDbContext> _testContext; private readonly ReadWriteFakers _fakers = new ReadWriteFakers(); public UpdateToOneRelationshipTests(ExampleIntegrationTestContext, ReadWriteDbContext> testContext) - : base(testContext) { _testContext = testContext; + + testContext.AddController(); + testContext.AddController(); + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RequiredRelationships/DefaultBehaviorTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RequiredRelationships/DefaultBehaviorTests.cs index 6b7072a110..a6068f0176 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RequiredRelationships/DefaultBehaviorTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RequiredRelationships/DefaultBehaviorTests.cs @@ -11,17 +11,23 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.RequiredRelationships { - public sealed class DefaultBehaviorTests : IntegrationTestCollection, DefaultBehaviorDbContext> + public sealed class DefaultBehaviorTests : IClassFixture, DefaultBehaviorDbContext>> { private readonly ExampleIntegrationTestContext, DefaultBehaviorDbContext> _testContext; private readonly DefaultBehaviorFakers _fakers = new DefaultBehaviorFakers(); public DefaultBehaviorTests(ExampleIntegrationTestContext, DefaultBehaviorDbContext> testContext) - : base(testContext) { _testContext = testContext; + testContext.AddController(); + ; + testContext.AddController(); + ; + testContext.AddController(); + ; + var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService(); options.UseRelativeLinks = true; } diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceConstructorInjection/ResourceInjectionTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceConstructorInjection/ResourceInjectionTests.cs index 052d1fda32..eb0df16882 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceConstructorInjection/ResourceInjectionTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceConstructorInjection/ResourceInjectionTests.cs @@ -15,16 +15,18 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ResourceConstructorInjection { - public sealed class ResourceInjectionTests : IntegrationTestCollection, InjectionDbContext> + public sealed class ResourceInjectionTests : IClassFixture, InjectionDbContext>> { private readonly ExampleIntegrationTestContext, InjectionDbContext> _testContext; private readonly InjectionFakers _fakers; public ResourceInjectionTests(ExampleIntegrationTestContext, InjectionDbContext> testContext) - : base(testContext) { _testContext = testContext; + testContext.AddController(); + testContext.AddController(); + testContext.ConfigureServicesBeforeStartup(services => { services.AddSingleton(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceDefinitions/ResourceDefinitionQueryCallbackTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceDefinitions/ResourceDefinitionQueryCallbackTests.cs index 8b69dca2ee..31f542cf25 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceDefinitions/ResourceDefinitionQueryCallbackTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceDefinitions/ResourceDefinitionQueryCallbackTests.cs @@ -14,15 +14,17 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ResourceDefinitions { - public sealed class ResourceDefinitionQueryCallbackTests : IntegrationTestCollection, CallableDbContext> + public sealed class ResourceDefinitionQueryCallbackTests + : IClassFixture, CallableDbContext>> { private readonly ExampleIntegrationTestContext, CallableDbContext> _testContext; public ResourceDefinitionQueryCallbackTests(ExampleIntegrationTestContext, CallableDbContext> testContext) - : base(testContext) { _testContext = testContext; + testContext.AddController(); + testContext.ConfigureServicesAfterStartup(services => { services.AddScoped, CallableResourceDefinition>(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceHooks/ResourceHookTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceHooks/ResourceHookTests.cs index db76c2ae8b..5226deb73a 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceHooks/ResourceHookTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceHooks/ResourceHookTests.cs @@ -30,7 +30,12 @@ public ResourceHookTests(ExampleIntegrationTestContext(); + testContext.AddController(); + testContext.AddController(); + testContext.AddController(); + testContext.AddController(); + testContext.AddController(); + testContext.AddController(); testContext.ConfigureServicesAfterStartup(services => { diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceInheritance/InheritanceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceInheritance/InheritanceTests.cs index fb070f593e..1e93c2befd 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceInheritance/InheritanceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceInheritance/InheritanceTests.cs @@ -13,14 +13,15 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ResourceInheritance { - public sealed class InheritanceTests : IntegrationTestCollection, InheritanceDbContext> + public sealed class InheritanceTests : IClassFixture, InheritanceDbContext>> { private readonly ExampleIntegrationTestContext, InheritanceDbContext> _testContext; public InheritanceTests(ExampleIntegrationTestContext, InheritanceDbContext> testContext) - : base(testContext) { _testContext = testContext; + + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/DisableQueryStringTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/DisableQueryStringTests.cs index d25e891bf7..a668baa6b1 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/DisableQueryStringTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/DisableQueryStringTests.cs @@ -11,15 +11,17 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.RestrictedControllers { - public sealed class DisableQueryStringTests : IntegrationTestCollection, RestrictionDbContext> + public sealed class DisableQueryStringTests : IClassFixture, RestrictionDbContext>> { private readonly ExampleIntegrationTestContext, RestrictionDbContext> _testContext; public DisableQueryStringTests(ExampleIntegrationTestContext, RestrictionDbContext> testContext) - : base(testContext) { _testContext = testContext; + testContext.AddController(); + testContext.AddController(); + testContext.ConfigureServicesAfterStartup(services => { services.AddScoped(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/HttpReadOnlyTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/HttpReadOnlyTests.cs index 37a6207832..5b34c381ae 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/HttpReadOnlyTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/HttpReadOnlyTests.cs @@ -9,15 +9,16 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.RestrictedControllers { - public sealed class HttpReadOnlyTests : IntegrationTestCollection, RestrictionDbContext> + public sealed class HttpReadOnlyTests : IClassFixture, RestrictionDbContext>> { private readonly ExampleIntegrationTestContext, RestrictionDbContext> _testContext; private readonly RestrictionFakers _fakers = new RestrictionFakers(); public HttpReadOnlyTests(ExampleIntegrationTestContext, RestrictionDbContext> testContext) - : base(testContext) { _testContext = testContext; + + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpDeleteTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpDeleteTests.cs index 6f1e51af87..b51b5350bb 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpDeleteTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpDeleteTests.cs @@ -9,15 +9,16 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.RestrictedControllers { - public sealed class NoHttpDeleteTests : IntegrationTestCollection, RestrictionDbContext> + public sealed class NoHttpDeleteTests : IClassFixture, RestrictionDbContext>> { private readonly ExampleIntegrationTestContext, RestrictionDbContext> _testContext; private readonly RestrictionFakers _fakers = new RestrictionFakers(); public NoHttpDeleteTests(ExampleIntegrationTestContext, RestrictionDbContext> testContext) - : base(testContext) { _testContext = testContext; + + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPatchTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPatchTests.cs index f0fb855bc2..cfd85e50ed 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPatchTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPatchTests.cs @@ -9,15 +9,16 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.RestrictedControllers { - public sealed class NoHttpPatchTests : IntegrationTestCollection, RestrictionDbContext> + public sealed class NoHttpPatchTests : IClassFixture, RestrictionDbContext>> { private readonly ExampleIntegrationTestContext, RestrictionDbContext> _testContext; private readonly RestrictionFakers _fakers = new RestrictionFakers(); public NoHttpPatchTests(ExampleIntegrationTestContext, RestrictionDbContext> testContext) - : base(testContext) { _testContext = testContext; + + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPostTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPostTests.cs index cbffda45d6..1ad390e64f 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPostTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPostTests.cs @@ -9,15 +9,16 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.RestrictedControllers { - public sealed class NoHttpPostTests : IntegrationTestCollection, RestrictionDbContext> + public sealed class NoHttpPostTests : IClassFixture, RestrictionDbContext>> { private readonly ExampleIntegrationTestContext, RestrictionDbContext> _testContext; private readonly RestrictionFakers _fakers = new RestrictionFakers(); public NoHttpPostTests(ExampleIntegrationTestContext, RestrictionDbContext> testContext) - : base(testContext) { _testContext = testContext; + + testContext.AddController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Serialization/SerializationTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Serialization/SerializationTests.cs index bb26555d15..cd085ddedc 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Serialization/SerializationTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Serialization/SerializationTests.cs @@ -17,16 +17,18 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.Serialization { - public sealed class SerializationTests : IntegrationTestCollection, SerializationDbContext> + public sealed class SerializationTests : IClassFixture, SerializationDbContext>> { private readonly ExampleIntegrationTestContext, SerializationDbContext> _testContext; private readonly SerializationFakers _fakers = new SerializationFakers(); public SerializationTests(ExampleIntegrationTestContext, SerializationDbContext> testContext) - : base(testContext) { _testContext = testContext; + testContext.AddController(); + testContext.AddController(); + testContext.ConfigureServicesAfterStartup(services => { services.AddScoped(typeof(IResourceChangeTracker<>), typeof(NeverSameResourceChangeTracker<>)); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/SoftDeletion/SoftDeletionTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/SoftDeletion/SoftDeletionTests.cs index 739420cbdc..2cf0ccbc37 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/SoftDeletion/SoftDeletionTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/SoftDeletion/SoftDeletionTests.cs @@ -13,15 +13,17 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.SoftDeletion { - public sealed class SoftDeletionTests : IntegrationTestCollection, SoftDeletionDbContext> + public sealed class SoftDeletionTests : IClassFixture, SoftDeletionDbContext>> { private readonly ExampleIntegrationTestContext, SoftDeletionDbContext> _testContext; public SoftDeletionTests(ExampleIntegrationTestContext, SoftDeletionDbContext> testContext) - : base(testContext) { _testContext = testContext; + testContext.AddController(); + testContext.AddController(); + testContext.ConfigureServicesAfterStartup(services => { services.AddScoped, SoftDeletionResourceDefinition>(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/EmptyGuidAsKeyTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/EmptyGuidAsKeyTests.cs index e994614f2f..8edea56cb6 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/EmptyGuidAsKeyTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/EmptyGuidAsKeyTests.cs @@ -15,16 +15,19 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ZeroKeys { - public sealed class EmptyGuidAsKeyTests : IntegrationTestCollection, ZeroKeyDbContext> + public sealed class EmptyGuidAsKeyTests : IClassFixture, ZeroKeyDbContext>> { private readonly ExampleIntegrationTestContext, ZeroKeyDbContext> _testContext; private readonly ZeroKeyFakers _fakers = new ZeroKeyFakers(); public EmptyGuidAsKeyTests(ExampleIntegrationTestContext, ZeroKeyDbContext> testContext) - : base(testContext) { _testContext = testContext; + testContext.AddController(); + testContext.AddController(); + testContext.AddController(); + var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService(); options.UseRelativeLinks = true; options.AllowClientGeneratedIds = true; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/ZeroAsKeyTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/ZeroAsKeyTests.cs index ec8aae49c7..5fe6ac3665 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/ZeroAsKeyTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/ZeroAsKeyTests.cs @@ -14,16 +14,19 @@ namespace JsonApiDotNetCoreExampleTests.IntegrationTests.ZeroKeys { - public sealed class ZeroAsKeyTests : IntegrationTestCollection, ZeroKeyDbContext> + public sealed class ZeroAsKeyTests : IClassFixture, ZeroKeyDbContext>> { private readonly ExampleIntegrationTestContext, ZeroKeyDbContext> _testContext; private readonly ZeroKeyFakers _fakers = new ZeroKeyFakers(); public ZeroAsKeyTests(ExampleIntegrationTestContext, ZeroKeyDbContext> testContext) - : base(testContext) { _testContext = testContext; + testContext.AddController(); + testContext.AddController(); + testContext.AddController(); + var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService(); options.UseRelativeLinks = true; options.AllowClientGeneratedIds = true; diff --git a/test/TestBuildingBlocks/BaseIntegrationTestContext.cs b/test/TestBuildingBlocks/BaseIntegrationTestContext.cs index 478e766b46..99ae202440 100644 --- a/test/TestBuildingBlocks/BaseIntegrationTestContext.cs +++ b/test/TestBuildingBlocks/BaseIntegrationTestContext.cs @@ -2,6 +2,7 @@ using System.Net.Http; using System.Threading.Tasks; using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Testing; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; @@ -43,16 +44,11 @@ protected BaseIntegrationTestContext() } public void AddController() - where TController : class + where TController : ControllerBase { _testControllerProvider.AddController(typeof(TController)); } - public void AddControllersInNamespaceOf() - { - _testControllerProvider.AddNamespaceEntrypoint(typeof(TNamespaceEntryPoint)); - } - protected override HttpClient CreateClient() { return Factory.CreateClient(); diff --git a/test/TestBuildingBlocks/TestControllerProvider.cs b/test/TestBuildingBlocks/TestControllerProvider.cs index 3c70daf013..6d81933eab 100644 --- a/test/TestBuildingBlocks/TestControllerProvider.cs +++ b/test/TestBuildingBlocks/TestControllerProvider.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Reflection; using Microsoft.AspNetCore.Mvc.Controllers; @@ -8,9 +7,7 @@ namespace TestBuildingBlocks { internal sealed class TestControllerProvider : ControllerFeatureProvider { - private readonly IList _namespaceEntryPoints = new List(); private readonly IList _allowedControllerTypes = new List(); - private string[] _namespaces; internal ISet ControllerAssemblies { get; } = new HashSet(); public void AddController(Type controller) @@ -19,12 +16,6 @@ public void AddController(Type controller) ControllerAssemblies.Add(controller.Assembly); } - public void AddNamespaceEntrypoint(Type entrypoint) - { - _namespaceEntryPoints.Add(entrypoint); - ControllerAssemblies.Add(entrypoint.Assembly); - } - protected override bool IsController(TypeInfo typeInfo) { if (!base.IsController(typeInfo)) @@ -32,10 +23,7 @@ protected override bool IsController(TypeInfo typeInfo) return false; } - _namespaces ??= _namespaceEntryPoints.Select(type => type.Namespace).ToArray(); - - return _allowedControllerTypes.Contains(typeInfo) || - _namespaces.Any(@namespace => typeInfo.Namespace!.StartsWith(@namespace, StringComparison.Ordinal)); + return _allowedControllerTypes.Contains(typeInfo); } } } From 23d9f4ce135dde5afe3843e4067fe8f98a36d01f Mon Sep 17 00:00:00 2001 From: maurei Date: Wed, 17 Mar 2021 16:26:21 +0100 Subject: [PATCH 13/18] remove redundant files --- .../ExampleIntegrationTestContext.cs | 12 ------------ .../BaseIntegrationTestContext.cs | 9 +++------ test/TestBuildingBlocks/NoModelsDbContext.cs | 14 -------------- 3 files changed, 3 insertions(+), 32 deletions(-) delete mode 100644 test/TestBuildingBlocks/NoModelsDbContext.cs diff --git a/test/JsonApiDotNetCoreExampleTests/ExampleIntegrationTestContext.cs b/test/JsonApiDotNetCoreExampleTests/ExampleIntegrationTestContext.cs index 17232f5bca..d7dc3d3bd9 100644 --- a/test/JsonApiDotNetCoreExampleTests/ExampleIntegrationTestContext.cs +++ b/test/JsonApiDotNetCoreExampleTests/ExampleIntegrationTestContext.cs @@ -20,16 +20,4 @@ public class ExampleIntegrationTestContext : BaseIntegrati where TDbContext : DbContext { } - - /// - /// A test context for tests that reference the JsonApiDotNetCoreExample project when no database is needed. - /// - /// - /// The server Startup class, which can be defined in the test project. - /// - [UsedImplicitly(ImplicitUseKindFlags.InstantiatedNoFixedConstructorSignature)] - public sealed class ExampleIntegrationTestContext : BaseIntegrationTestContext - where TStartup : class - { - } } diff --git a/test/TestBuildingBlocks/BaseIntegrationTestContext.cs b/test/TestBuildingBlocks/BaseIntegrationTestContext.cs index 99ae202440..c61c4eb453 100644 --- a/test/TestBuildingBlocks/BaseIntegrationTestContext.cs +++ b/test/TestBuildingBlocks/BaseIntegrationTestContext.cs @@ -80,12 +80,9 @@ private WebApplicationFactory CreateFactory() factory.ConfigureServicesAfterStartup(_afterServicesConfiguration); - if (typeof(TDbContext) != typeof(NoModelsDbContext)) - { - using IServiceScope scope = factory.Services.CreateScope(); - var dbContext = scope.ServiceProvider.GetRequiredService(); - dbContext.Database.EnsureCreated(); - } + using IServiceScope scope = factory.Services.CreateScope(); + var dbContext = scope.ServiceProvider.GetRequiredService(); + dbContext.Database.EnsureCreated(); return factory; } diff --git a/test/TestBuildingBlocks/NoModelsDbContext.cs b/test/TestBuildingBlocks/NoModelsDbContext.cs deleted file mode 100644 index e34d195b21..0000000000 --- a/test/TestBuildingBlocks/NoModelsDbContext.cs +++ /dev/null @@ -1,14 +0,0 @@ -using JetBrains.Annotations; -using Microsoft.EntityFrameworkCore; - -namespace TestBuildingBlocks -{ - [UsedImplicitly(ImplicitUseTargetFlags.Members)] - public sealed class NoModelsDbContext : DbContext - { - public NoModelsDbContext(DbContextOptions options) - : base(options) - { - } - } -} From 4a42678e13e0ce7580d25575f9aa11d074eb6ae3 Mon Sep 17 00:00:00 2001 From: maurei Date: Wed, 17 Mar 2021 16:31:00 +0100 Subject: [PATCH 14/18] removed commented out code --- .../IntegrationTests/ResourceHooks/ResourceHooksStartup.cs | 2 -- test/TestBuildingBlocks/TestControllerProvider.cs | 5 ----- 2 files changed, 7 deletions(-) diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceHooks/ResourceHooksStartup.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceHooks/ResourceHooksStartup.cs index 52e4187e1c..51f0a08c51 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceHooks/ResourceHooksStartup.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceHooks/ResourceHooksStartup.cs @@ -13,8 +13,6 @@ public sealed class ResourceHooksStartup : TestableStartup Date: Wed, 17 Mar 2021 16:41:44 +0100 Subject: [PATCH 15/18] Update ExampleIntegrationTestContext.cs --- .../ExampleIntegrationTestContext.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/JsonApiDotNetCoreExampleTests/ExampleIntegrationTestContext.cs b/test/JsonApiDotNetCoreExampleTests/ExampleIntegrationTestContext.cs index d7dc3d3bd9..96c92656db 100644 --- a/test/JsonApiDotNetCoreExampleTests/ExampleIntegrationTestContext.cs +++ b/test/JsonApiDotNetCoreExampleTests/ExampleIntegrationTestContext.cs @@ -15,7 +15,7 @@ namespace JsonApiDotNetCoreExampleTests /// The EF Core database context, which can be defined in the test project. /// [UsedImplicitly(ImplicitUseKindFlags.InstantiatedNoFixedConstructorSignature)] - public class ExampleIntegrationTestContext : BaseIntegrationTestContext + public sealed class ExampleIntegrationTestContext : BaseIntegrationTestContext where TStartup : class where TDbContext : DbContext { From 503951a2e2b727205ba0ce15e3595e3de8bf82e6 Mon Sep 17 00:00:00 2001 From: Bart Koelman Date: Wed, 17 Mar 2021 21:36:04 +0100 Subject: [PATCH 16/18] Fix cibuild --- .../RequiredRelationships/DefaultBehaviorTests.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RequiredRelationships/DefaultBehaviorTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RequiredRelationships/DefaultBehaviorTests.cs index a6068f0176..266203b116 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RequiredRelationships/DefaultBehaviorTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RequiredRelationships/DefaultBehaviorTests.cs @@ -22,11 +22,8 @@ public DefaultBehaviorTests(ExampleIntegrationTestContext(); - ; testContext.AddController(); - ; testContext.AddController(); - ; var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService(); options.UseRelativeLinks = true; From ac78f5626adfd8e7233686aaa699497a57b0c2f9 Mon Sep 17 00:00:00 2001 From: maurei Date: Thu, 18 Mar 2021 10:51:15 +0100 Subject: [PATCH 17/18] review --- .../Middleware/JsonApiRoutingConvention.cs | 8 ++++---- .../AtomicConstrainedOperationsControllerTests.cs | 2 +- .../Creating/AtomicCreateResourceTests.cs | 2 +- ...AtomicCreateResourceWithClientGeneratedIdTests.cs | 2 +- ...tomicCreateResourceWithToManyRelationshipTests.cs | 2 +- ...AtomicCreateResourceWithToOneRelationshipTests.cs | 2 +- .../Deleting/AtomicDeleteResourceTests.cs | 2 +- .../Links/AtomicAbsoluteLinksTests.cs | 2 +- .../Links/AtomicRelativeLinksWithNamespaceTests.cs | 2 +- .../AtomicOperations/LocalIds/AtomicLocalIdTests.cs | 2 +- .../AtomicOperations/Meta/AtomicResourceMetaTests.cs | 2 +- .../AtomicOperations/Meta/AtomicResponseMetaTests.cs | 2 +- .../AtomicOperations/Mixed/AtomicRequestBodyTests.cs | 2 +- .../Mixed/MaximumOperationsPerRequestTests.cs | 2 +- .../AtomicModelStateValidationTests.cs | 2 +- .../QueryStrings/AtomicQueryStringTests.cs | 4 ++-- .../AtomicSparseFieldSetResourceDefinitionTests.cs | 2 +- .../Transactions/AtomicRollbackTests.cs | 2 +- .../AtomicTransactionConsistencyTests.cs | 2 +- .../AtomicAddToToManyRelationshipTests.cs | 2 +- .../AtomicRemoveFromToManyRelationshipTests.cs | 2 +- .../AtomicReplaceToManyRelationshipTests.cs | 2 +- .../AtomicUpdateToOneRelationshipTests.cs | 2 +- .../AtomicReplaceToManyRelationshipTests.cs | 2 +- .../Updating/Resources/AtomicUpdateResourceTests.cs | 2 +- .../Resources/AtomicUpdateToOneRelationshipTests.cs | 2 +- .../CompositeKeys/CompositeKeyTests.cs | 6 +++--- .../ContentNegotiation/AcceptHeaderTests.cs | 4 ++-- .../ContentNegotiation/ContentTypeHeaderTests.cs | 4 ++-- .../ControllerActionResults/ActionResultTests.cs | 2 +- .../CustomRoutes/ApiControllerAttributeTests.cs | 2 +- .../CustomRoutes/CustomRouteTests.cs | 4 ++-- .../EagerLoading/EagerLoadingTests.cs | 6 +++--- .../ExceptionHandling/ExceptionHandlerTests.cs | 4 ++-- .../IntegrationTests/HostingInIIS/HostingTests.cs | 4 ++-- .../IdObfuscation/IdObfuscationTests.cs | 4 ++-- .../Links/AbsoluteLinksWithNamespaceTests.cs | 4 ++-- .../Links/AbsoluteLinksWithoutNamespaceTests.cs | 4 ++-- .../IntegrationTests/Links/LinkInclusionTests.cs | 2 +- .../Links/RelativeLinksWithNamespaceTests.cs | 4 ++-- .../Links/RelativeLinksWithoutNamespaceTests.cs | 4 ++-- .../IntegrationTests/Logging/LoggingTests.cs | 2 +- .../IntegrationTests/Meta/ResourceMetaTests.cs | 4 ++-- .../IntegrationTests/Meta/ResponseMetaTests.cs | 4 ++-- .../IntegrationTests/Meta/TopLevelCountTests.cs | 4 ++-- .../ModelStateValidationTests.cs | 4 ++-- .../NoModelStateValidationTests.cs | 4 ++-- .../NamingConventions/KebabCasingTests.cs | 4 ++-- .../QueryStrings/Filtering/FilterDataTypeTests.cs | 2 +- .../QueryStrings/Filtering/FilterDepthTests.cs | 4 ++-- .../QueryStrings/Filtering/FilterOperatorTests.cs | 2 +- .../QueryStrings/Filtering/FilterTests.cs | 2 +- .../QueryStrings/Includes/IncludeTests.cs | 8 ++++---- .../Pagination/PaginationWithTotalCountTests.cs | 6 +++--- .../Pagination/PaginationWithoutTotalCountTests.cs | 4 ++-- .../QueryStrings/Pagination/RangeValidationTests.cs | 2 +- .../Pagination/RangeValidationWithMaximumTests.cs | 2 +- .../QueryStrings/QueryStringTests.cs | 2 +- .../SerializerDefaultValueHandlingTests.cs | 2 +- .../QueryStrings/SerializerNullValueHandlingTests.cs | 2 +- .../QueryStrings/Sorting/SortTests.cs | 6 +++--- .../SparseFieldSets/SparseFieldSetTests.cs | 6 +++--- .../ReadWrite/Creating/CreateResourceTests.cs | 8 ++++---- .../CreateResourceWithClientGeneratedIdTests.cs | 4 ++-- .../CreateResourceWithToManyRelationshipTests.cs | 4 ++-- .../CreateResourceWithToOneRelationshipTests.cs | 6 +++--- .../ReadWrite/Deleting/DeleteResourceTests.cs | 6 +++--- .../ReadWrite/Fetching/FetchRelationshipTests.cs | 4 ++-- .../ReadWrite/Fetching/FetchResourceTests.cs | 4 ++-- .../Relationships/AddToToManyRelationshipTests.cs | 2 +- .../RemoveFromToManyRelationshipTests.cs | 2 +- .../Relationships/ReplaceToManyRelationshipTests.cs | 2 +- .../Relationships/UpdateToOneRelationshipTests.cs | 6 +++--- .../Resources/ReplaceToManyRelationshipTests.cs | 2 +- .../Updating/Resources/UpdateResourceTests.cs | 8 ++++---- .../Resources/UpdateToOneRelationshipTests.cs | 6 +++--- .../RequiredRelationships/DefaultBehaviorTests.cs | 6 +++--- .../ResourceInjectionTests.cs | 4 ++-- .../ResourceDefinitionQueryCallbackTests.cs | 2 +- .../ResourceHooks/ResourceHookTests.cs | 12 ++++++------ .../ResourceInheritance/InheritanceTests.cs | 2 +- .../RestrictedControllers/DisableQueryStringTests.cs | 4 ++-- .../RestrictedControllers/HttpReadOnlyTests.cs | 2 +- .../RestrictedControllers/NoHttpDeleteTests.cs | 2 +- .../RestrictedControllers/NoHttpPatchTests.cs | 2 +- .../RestrictedControllers/NoHttpPostTests.cs | 2 +- .../Serialization/SerializationTests.cs | 4 ++-- .../SoftDeletion/SoftDeletionTests.cs | 4 ++-- .../IntegrationTests/ZeroKeys/EmptyGuidAsKeyTests.cs | 6 +++--- .../IntegrationTests/ZeroKeys/ZeroAsKeyTests.cs | 6 +++--- .../TestBuildingBlocks/BaseIntegrationTestContext.cs | 6 +++--- .../ServiceCollectionExtensions.cs | 2 +- test/TestBuildingBlocks/TestControllerProvider.cs | 2 +- 93 files changed, 163 insertions(+), 163 deletions(-) diff --git a/src/JsonApiDotNetCore/Middleware/JsonApiRoutingConvention.cs b/src/JsonApiDotNetCore/Middleware/JsonApiRoutingConvention.cs index d5ec6c4ca9..6063c81a3d 100644 --- a/src/JsonApiDotNetCore/Middleware/JsonApiRoutingConvention.cs +++ b/src/JsonApiDotNetCore/Middleware/JsonApiRoutingConvention.cs @@ -33,7 +33,7 @@ public class JsonApiRoutingConvention : IJsonApiRoutingConvention { private readonly IJsonApiOptions _options; private readonly IResourceContextProvider _resourceContextProvider; - private readonly Dictionary _registeredTemplates = new Dictionary(); + private readonly Dictionary _registeredControllerNameByTemplate = new Dictionary(); private readonly Dictionary _resourceContextPerControllerTypeMap = new Dictionary(); public JsonApiRoutingConvention(IJsonApiOptions options, IResourceContextProvider resourceContextProvider) @@ -89,13 +89,13 @@ public void Apply(ApplicationModel application) string template = TemplateFromResource(controller) ?? TemplateFromController(controller); - if (_registeredTemplates.ContainsKey(template)) + if (_registeredControllerNameByTemplate.ContainsKey(template)) { throw new InvalidConfigurationException( - $"Cannot register '{controller.ControllerType.FullName}' for template '{template}' because '{_registeredTemplates[template].ControllerType.FullName}' was already registered for this template."); + $"Cannot register '{controller.ControllerType.FullName}' for template '{template}' because '{_registeredControllerNameByTemplate[template]}' was already registered for this template."); } - _registeredTemplates.Add(template, controller); + _registeredControllerNameByTemplate.Add(template, controller.ControllerType.FullName); controller.Selectors[0].AttributeRouteModel = new AttributeRouteModel { diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Controllers/AtomicConstrainedOperationsControllerTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Controllers/AtomicConstrainedOperationsControllerTests.cs index eea3046331..243e07294d 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Controllers/AtomicConstrainedOperationsControllerTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Controllers/AtomicConstrainedOperationsControllerTests.cs @@ -19,7 +19,7 @@ public AtomicConstrainedOperationsControllerTests(ExampleIntegrationTestContext< { _testContext = testContext; - testContext.AddController(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceTests.cs index 41f182ea46..39d5378f21 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceTests.cs @@ -24,7 +24,7 @@ public AtomicCreateResourceTests(ExampleIntegrationTestContext(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithClientGeneratedIdTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithClientGeneratedIdTests.cs index f66ebfc6d2..9c88b14335 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithClientGeneratedIdTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithClientGeneratedIdTests.cs @@ -24,7 +24,7 @@ public AtomicCreateResourceWithClientGeneratedIdTests( { _testContext = testContext; - testContext.AddController(); + testContext.UseController(); var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService(); options.AllowClientGeneratedIds = true; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToManyRelationshipTests.cs index 263eb0fd95..abd177bfe8 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToManyRelationshipTests.cs @@ -24,7 +24,7 @@ public AtomicCreateResourceWithToManyRelationshipTests( { _testContext = testContext; - testContext.AddController(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToOneRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToOneRelationshipTests.cs index 337cd1ccf5..9a1dceef3a 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToOneRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceWithToOneRelationshipTests.cs @@ -26,7 +26,7 @@ public AtomicCreateResourceWithToOneRelationshipTests( { _testContext = testContext; - testContext.AddController(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Deleting/AtomicDeleteResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Deleting/AtomicDeleteResourceTests.cs index e022ea3c9d..360a39de53 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Deleting/AtomicDeleteResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Deleting/AtomicDeleteResourceTests.cs @@ -23,7 +23,7 @@ public AtomicDeleteResourceTests(ExampleIntegrationTestContext(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicAbsoluteLinksTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicAbsoluteLinksTests.cs index 5bc7ce5095..16bc2c68f3 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicAbsoluteLinksTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicAbsoluteLinksTests.cs @@ -23,7 +23,7 @@ public AtomicAbsoluteLinksTests(ExampleIntegrationTestContext(); + testContext.UseController(); testContext.ConfigureServicesAfterStartup(services => { diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicRelativeLinksWithNamespaceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicRelativeLinksWithNamespaceTests.cs index a41ff6619f..dafe56cc1e 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicRelativeLinksWithNamespaceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicRelativeLinksWithNamespaceTests.cs @@ -23,7 +23,7 @@ public AtomicRelativeLinksWithNamespaceTests( { _testContext = testContext; - testContext.AddController(); + testContext.UseController(); testContext.ConfigureServicesAfterStartup(services => { diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/LocalIds/AtomicLocalIdTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/LocalIds/AtomicLocalIdTests.cs index bd337db65d..0481b4c253 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/LocalIds/AtomicLocalIdTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/LocalIds/AtomicLocalIdTests.cs @@ -22,7 +22,7 @@ public AtomicLocalIdTests(ExampleIntegrationTestContext(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResourceMetaTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResourceMetaTests.cs index 177871c679..de71c07d49 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResourceMetaTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResourceMetaTests.cs @@ -23,7 +23,7 @@ public AtomicResourceMetaTests(ExampleIntegrationTestContext(); + testContext.UseController(); testContext.ConfigureServicesAfterStartup(services => { diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResponseMetaTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResponseMetaTests.cs index 22d0932e3c..facb8dc4a9 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResponseMetaTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Meta/AtomicResponseMetaTests.cs @@ -24,7 +24,7 @@ public AtomicResponseMetaTests(ExampleIntegrationTestContext(); + testContext.UseController(); testContext.ConfigureServicesAfterStartup(services => { diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/AtomicRequestBodyTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/AtomicRequestBodyTests.cs index 2ca232c05d..8b7084b4fe 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/AtomicRequestBodyTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/AtomicRequestBodyTests.cs @@ -20,7 +20,7 @@ public AtomicRequestBodyTests(ExampleIntegrationTestContext(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/MaximumOperationsPerRequestTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/MaximumOperationsPerRequestTests.cs index 20aa77ab0c..fcc49f7c2e 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/MaximumOperationsPerRequestTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Mixed/MaximumOperationsPerRequestTests.cs @@ -22,7 +22,7 @@ public MaximumOperationsPerRequestTests(ExampleIntegrationTestContext(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ModelStateValidation/AtomicModelStateValidationTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ModelStateValidation/AtomicModelStateValidationTests.cs index ef00ded3a8..a86bef8595 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ModelStateValidation/AtomicModelStateValidationTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ModelStateValidation/AtomicModelStateValidationTests.cs @@ -21,7 +21,7 @@ public AtomicModelStateValidationTests(ExampleIntegrationTestContext(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/QueryStrings/AtomicQueryStringTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/QueryStrings/AtomicQueryStringTests.cs index 502e090e26..ebcf1fe882 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/QueryStrings/AtomicQueryStringTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/QueryStrings/AtomicQueryStringTests.cs @@ -28,8 +28,8 @@ public AtomicQueryStringTests(ExampleIntegrationTestContext(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); testContext.ConfigureServicesAfterStartup(services => { diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ResourceDefinitions/AtomicSparseFieldSetResourceDefinitionTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ResourceDefinitions/AtomicSparseFieldSetResourceDefinitionTests.cs index 1c485fd462..144c0df61a 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ResourceDefinitions/AtomicSparseFieldSetResourceDefinitionTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ResourceDefinitions/AtomicSparseFieldSetResourceDefinitionTests.cs @@ -23,7 +23,7 @@ public AtomicSparseFieldSetResourceDefinitionTests(ExampleIntegrationTestContext { _testContext = testContext; - testContext.AddController(); + testContext.UseController(); testContext.ConfigureServicesAfterStartup(services => { diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicRollbackTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicRollbackTests.cs index 6d60e98ee6..2f01f4aaa2 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicRollbackTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicRollbackTests.cs @@ -22,7 +22,7 @@ public AtomicRollbackTests(ExampleIntegrationTestContext(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicTransactionConsistencyTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicTransactionConsistencyTests.cs index d8fbec31a6..4f6508fe4c 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicTransactionConsistencyTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Transactions/AtomicTransactionConsistencyTests.cs @@ -23,7 +23,7 @@ public AtomicTransactionConsistencyTests(ExampleIntegrationTestContext(); + testContext.UseController(); testContext.ConfigureServicesAfterStartup(services => { diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicAddToToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicAddToToManyRelationshipTests.cs index 14c8a312b4..98d15f5459 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicAddToToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicAddToToManyRelationshipTests.cs @@ -24,7 +24,7 @@ public AtomicAddToToManyRelationshipTests(ExampleIntegrationTestContext(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicRemoveFromToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicRemoveFromToManyRelationshipTests.cs index c13e5a8b4b..f09d85cf36 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicRemoveFromToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicRemoveFromToManyRelationshipTests.cs @@ -24,7 +24,7 @@ public AtomicRemoveFromToManyRelationshipTests(ExampleIntegrationTestContext(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicReplaceToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicReplaceToManyRelationshipTests.cs index 6203026fd7..17606bd01d 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicReplaceToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicReplaceToManyRelationshipTests.cs @@ -24,7 +24,7 @@ public AtomicReplaceToManyRelationshipTests(ExampleIntegrationTestContext(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicUpdateToOneRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicUpdateToOneRelationshipTests.cs index 142b2985a7..a8bec2eaae 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicUpdateToOneRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicUpdateToOneRelationshipTests.cs @@ -23,7 +23,7 @@ public AtomicUpdateToOneRelationshipTests(ExampleIntegrationTestContext(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicReplaceToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicReplaceToManyRelationshipTests.cs index 32458a9253..004b3e777f 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicReplaceToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicReplaceToManyRelationshipTests.cs @@ -24,7 +24,7 @@ public AtomicReplaceToManyRelationshipTests(ExampleIntegrationTestContext(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateResourceTests.cs index 76af5653f5..5e6e328dc1 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateResourceTests.cs @@ -24,7 +24,7 @@ public AtomicUpdateResourceTests(ExampleIntegrationTestContext(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateToOneRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateToOneRelationshipTests.cs index d8f7f1eaa9..0460f5e2e5 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateToOneRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateToOneRelationshipTests.cs @@ -23,7 +23,7 @@ public AtomicUpdateToOneRelationshipTests(ExampleIntegrationTestContext(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CompositeKeys/CompositeKeyTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CompositeKeys/CompositeKeyTests.cs index 7ac010ac31..c541f86a39 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CompositeKeys/CompositeKeyTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CompositeKeys/CompositeKeyTests.cs @@ -22,9 +22,9 @@ public CompositeKeyTests(ExampleIntegrationTestContext(); - testContext.AddController(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); + testContext.UseController(); testContext.ConfigureServicesAfterStartup(services => { diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/AcceptHeaderTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/AcceptHeaderTests.cs index d85b6af081..107464ba36 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/AcceptHeaderTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/AcceptHeaderTests.cs @@ -20,8 +20,8 @@ public AcceptHeaderTests(ExampleIntegrationTestContext(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/ContentTypeHeaderTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/ContentTypeHeaderTests.cs index 60f92a02e2..8a2a831eca 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/ContentTypeHeaderTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ContentNegotiation/ContentTypeHeaderTests.cs @@ -19,8 +19,8 @@ public ContentTypeHeaderTests(ExampleIntegrationTestContext(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ControllerActionResults/ActionResultTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ControllerActionResults/ActionResultTests.cs index 004471f2ef..2e23a8746c 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ControllerActionResults/ActionResultTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ControllerActionResults/ActionResultTests.cs @@ -17,7 +17,7 @@ public ActionResultTests(ExampleIntegrationTestContext(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/ApiControllerAttributeTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/ApiControllerAttributeTests.cs index 270d659c2f..ecba79c327 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/ApiControllerAttributeTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/ApiControllerAttributeTests.cs @@ -17,7 +17,7 @@ public ApiControllerAttributeTests(ExampleIntegrationTestContext(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/CustomRouteTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/CustomRouteTests.cs index 3eaa81e63b..d974d38503 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/CustomRouteTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/CustomRoutes/CustomRouteTests.cs @@ -22,8 +22,8 @@ public CustomRouteTests(ExampleIntegrationTestContext(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/EagerLoading/EagerLoadingTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/EagerLoading/EagerLoadingTests.cs index baa7ecc702..317c114978 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/EagerLoading/EagerLoadingTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/EagerLoading/EagerLoadingTests.cs @@ -20,9 +20,9 @@ public EagerLoadingTests(ExampleIntegrationTestContext(); - testContext.AddController(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); + testContext.UseController(); testContext.ConfigureServicesAfterStartup(services => { diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ExceptionHandling/ExceptionHandlerTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ExceptionHandling/ExceptionHandlerTests.cs index a14d5fcdcc..1a9a272c03 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ExceptionHandling/ExceptionHandlerTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ExceptionHandling/ExceptionHandlerTests.cs @@ -24,8 +24,8 @@ public ExceptionHandlerTests(ExampleIntegrationTestContext(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); FakeLoggerFactory loggerFactory = null; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/HostingInIIS/HostingTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/HostingInIIS/HostingTests.cs index b881952cc7..e326e41805 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/HostingInIIS/HostingTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/HostingInIIS/HostingTests.cs @@ -20,8 +20,8 @@ public HostingTests(ExampleIntegrationTestContext(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/IdObfuscation/IdObfuscationTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/IdObfuscation/IdObfuscationTests.cs index bb40ab31d3..b941ff28f4 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/IdObfuscation/IdObfuscationTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/IdObfuscation/IdObfuscationTests.cs @@ -20,8 +20,8 @@ public IdObfuscationTests(ExampleIntegrationTestContext(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithNamespaceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithNamespaceTests.cs index 771cadd75c..c54d868a17 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithNamespaceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithNamespaceTests.cs @@ -25,8 +25,8 @@ public AbsoluteLinksWithNamespaceTests(ExampleIntegrationTestContext(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); testContext.ConfigureServicesAfterStartup(services => { diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithoutNamespaceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithoutNamespaceTests.cs index 53cfa4d1d5..db26b78f09 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithoutNamespaceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/AbsoluteLinksWithoutNamespaceTests.cs @@ -25,8 +25,8 @@ public AbsoluteLinksWithoutNamespaceTests(ExampleIntegrationTestContext(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); testContext.ConfigureServicesAfterStartup(services => { diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/LinkInclusionTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/LinkInclusionTests.cs index e438b5bc9d..c93426d464 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/LinkInclusionTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/LinkInclusionTests.cs @@ -18,7 +18,7 @@ public LinkInclusionTests(ExampleIntegrationTestContext(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithNamespaceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithNamespaceTests.cs index 9102bc7210..e77685caec 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithNamespaceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithNamespaceTests.cs @@ -23,8 +23,8 @@ public RelativeLinksWithNamespaceTests(ExampleIntegrationTestContext(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); testContext.ConfigureServicesAfterStartup(services => { diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithoutNamespaceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithoutNamespaceTests.cs index 6df8b19792..4d03d34dd7 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithoutNamespaceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Links/RelativeLinksWithoutNamespaceTests.cs @@ -23,8 +23,8 @@ public RelativeLinksWithoutNamespaceTests(ExampleIntegrationTestContext(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); testContext.ConfigureServicesAfterStartup(services => { diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Logging/LoggingTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Logging/LoggingTests.cs index 3810879d29..11311d5ebf 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Logging/LoggingTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Logging/LoggingTests.cs @@ -20,7 +20,7 @@ public LoggingTests(ExampleIntegrationTestContext(); + testContext.UseController(); FakeLoggerFactory loggerFactory = null; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResourceMetaTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResourceMetaTests.cs index f909a48fcf..0378db3434 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResourceMetaTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResourceMetaTests.cs @@ -21,8 +21,8 @@ public ResourceMetaTests(ExampleIntegrationTestContext(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); testContext.ConfigureServicesAfterStartup(services => { diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResponseMetaTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResponseMetaTests.cs index c45b76a5f3..e10b383a33 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResponseMetaTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/ResponseMetaTests.cs @@ -19,8 +19,8 @@ public ResponseMetaTests(ExampleIntegrationTestContext(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); testContext.ConfigureServicesAfterStartup(services => { diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/TopLevelCountTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/TopLevelCountTests.cs index dfb8fc60ee..176a526774 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/TopLevelCountTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Meta/TopLevelCountTests.cs @@ -21,8 +21,8 @@ public TopLevelCountTests(ExampleIntegrationTestContext(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); testContext.ConfigureServicesAfterStartup(services => { diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/ModelStateValidationTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/ModelStateValidationTests.cs index ca4499aefc..ac56b7c0fe 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/ModelStateValidationTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/ModelStateValidationTests.cs @@ -19,8 +19,8 @@ public ModelStateValidationTests(ExampleIntegrationTestContext(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/NoModelStateValidationTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/NoModelStateValidationTests.cs index 20c6a884d9..cf30a79101 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/NoModelStateValidationTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ModelStateValidation/NoModelStateValidationTests.cs @@ -17,8 +17,8 @@ public NoModelStateValidationTests(ExampleIntegrationTestContext(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NamingConventions/KebabCasingTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NamingConventions/KebabCasingTests.cs index b03ce53843..9d9bd9feb1 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NamingConventions/KebabCasingTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/NamingConventions/KebabCasingTests.cs @@ -18,8 +18,8 @@ public KebabCasingTests(ExampleIntegrationTestContext(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDataTypeTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDataTypeTests.cs index 6858c65587..648de3fd31 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDataTypeTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDataTypeTests.cs @@ -24,7 +24,7 @@ public FilterDataTypeTests(ExampleIntegrationTestContext(); + testContext.UseController(); var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService(); options.EnableLegacyFilterNotation = false; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDepthTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDepthTests.cs index 105b5e80d0..08eacbcde1 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDepthTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterDepthTests.cs @@ -23,8 +23,8 @@ public FilterDepthTests(ExampleIntegrationTestContext(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService(); options.EnableLegacyFilterNotation = false; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterOperatorTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterOperatorTests.cs index c198d6253f..a0979ff162 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterOperatorTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterOperatorTests.cs @@ -24,7 +24,7 @@ public FilterOperatorTests(ExampleIntegrationTestContext(); + testContext.UseController(); var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService(); options.EnableLegacyFilterNotation = false; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterTests.cs index 61c8cf64cd..c2437b3084 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Filtering/FilterTests.cs @@ -21,7 +21,7 @@ public FilterTests(ExampleIntegrationTestContext(); + testContext.UseController(); var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService(); options.EnableLegacyFilterNotation = false; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Includes/IncludeTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Includes/IncludeTests.cs index dd2661ad92..c7981f3ea7 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Includes/IncludeTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Includes/IncludeTests.cs @@ -22,10 +22,10 @@ public IncludeTests(ExampleIntegrationTestContext(); - testContext.AddController(); - testContext.AddController(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); + testContext.UseController(); + testContext.UseController(); var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService(); options.MaximumIncludeDepth = null; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithTotalCountTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithTotalCountTests.cs index c358b767a4..338bd2d843 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithTotalCountTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithTotalCountTests.cs @@ -26,9 +26,9 @@ public PaginationWithTotalCountTests(ExampleIntegrationTestContext(); - testContext.AddController(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); + testContext.UseController(); var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService(); options.IncludeTotalResourceCount = true; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithoutTotalCountTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithoutTotalCountTests.cs index 897aeb5b3b..7a2b94dbee 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithoutTotalCountTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/PaginationWithoutTotalCountTests.cs @@ -25,8 +25,8 @@ public PaginationWithoutTotalCountTests(ExampleIntegrationTestContext(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService(); options.IncludeTotalResourceCount = false; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationTests.cs index 5c91afed80..8e31b58d15 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationTests.cs @@ -22,7 +22,7 @@ public RangeValidationTests(ExampleIntegrationTestContext(); + testContext.UseController(); var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService(); options.DefaultPageSize = new PageSize(DefaultPageSize); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationWithMaximumTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationWithMaximumTests.cs index f1ac1ffd4c..0e3833afac 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationWithMaximumTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Pagination/RangeValidationWithMaximumTests.cs @@ -22,7 +22,7 @@ public RangeValidationWithMaximumTests(ExampleIntegrationTestContext(); + testContext.UseController(); var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService(); options.DefaultPageSize = new PageSize(5); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/QueryStringTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/QueryStringTests.cs index ba4ef2e697..d7a346d6a1 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/QueryStringTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/QueryStringTests.cs @@ -19,7 +19,7 @@ public QueryStringTests(ExampleIntegrationTestContext(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerDefaultValueHandlingTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerDefaultValueHandlingTests.cs index 25fb8cc0b2..09d62b9acd 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerDefaultValueHandlingTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerDefaultValueHandlingTests.cs @@ -23,7 +23,7 @@ public SerializerDefaultValueHandlingTests(ExampleIntegrationTestContext(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerNullValueHandlingTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerNullValueHandlingTests.cs index 9afd76ac62..87294c7f53 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerNullValueHandlingTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SerializerNullValueHandlingTests.cs @@ -23,7 +23,7 @@ public SerializerNullValueHandlingTests(ExampleIntegrationTestContext(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Sorting/SortTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Sorting/SortTests.cs index c9716739e6..baf2bb4e61 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Sorting/SortTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/Sorting/SortTests.cs @@ -21,9 +21,9 @@ public SortTests(ExampleIntegrationTestContext(); - testContext.AddController(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SparseFieldSets/SparseFieldSetTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SparseFieldSets/SparseFieldSetTests.cs index ad8563cc1a..8518a9237b 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SparseFieldSets/SparseFieldSetTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/QueryStrings/SparseFieldSets/SparseFieldSetTests.cs @@ -22,9 +22,9 @@ public SparseFieldSetTests(ExampleIntegrationTestContext(); - testContext.AddController(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); + testContext.UseController(); testContext.ConfigureServicesAfterStartup(services => { diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceTests.cs index c5b8ae3d13..9e3c4084e2 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceTests.cs @@ -26,10 +26,10 @@ public CreateResourceTests(ExampleIntegrationTestContext(); - testContext.AddController(); - testContext.AddController(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); + testContext.UseController(); + testContext.UseController(); var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService(); options.UseRelativeLinks = false; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithClientGeneratedIdTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithClientGeneratedIdTests.cs index e62698b833..24bc72bcdc 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithClientGeneratedIdTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithClientGeneratedIdTests.cs @@ -24,8 +24,8 @@ public CreateResourceWithClientGeneratedIdTests(ExampleIntegrationTestContext(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService(); options.AllowClientGeneratedIds = true; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToManyRelationshipTests.cs index b5a582743c..240c0447cd 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToManyRelationshipTests.cs @@ -22,8 +22,8 @@ public CreateResourceWithToManyRelationshipTests(ExampleIntegrationTestContext(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToOneRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToOneRelationshipTests.cs index 68be82747f..8b5fc0844f 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToOneRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Creating/CreateResourceWithToOneRelationshipTests.cs @@ -25,9 +25,9 @@ public CreateResourceWithToOneRelationshipTests(ExampleIntegrationTestContext(); - testContext.AddController(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); + testContext.UseController(); var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService(); options.AllowClientGeneratedIds = true; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Deleting/DeleteResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Deleting/DeleteResourceTests.cs index 923734b40c..1a13fdea64 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Deleting/DeleteResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Deleting/DeleteResourceTests.cs @@ -21,9 +21,9 @@ public DeleteResourceTests(ExampleIntegrationTestContext(); - testContext.AddController(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchRelationshipTests.cs index c3b34fe51b..7a0d98d607 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchRelationshipTests.cs @@ -20,8 +20,8 @@ public FetchRelationshipTests(ExampleIntegrationTestContext(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchResourceTests.cs index b1e4efb30a..bf1cef5374 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Fetching/FetchResourceTests.cs @@ -20,8 +20,8 @@ public FetchResourceTests(ExampleIntegrationTestContext(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/AddToToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/AddToToManyRelationshipTests.cs index de368c115a..7e61c97934 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/AddToToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/AddToToManyRelationshipTests.cs @@ -21,7 +21,7 @@ public AddToToManyRelationshipTests(ExampleIntegrationTestContext(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/RemoveFromToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/RemoveFromToManyRelationshipTests.cs index 63d4398850..e716cdf1c1 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/RemoveFromToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/RemoveFromToManyRelationshipTests.cs @@ -22,7 +22,7 @@ public RemoveFromToManyRelationshipTests(ExampleIntegrationTestContext(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/ReplaceToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/ReplaceToManyRelationshipTests.cs index 27419742ee..05fc7db25b 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/ReplaceToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/ReplaceToManyRelationshipTests.cs @@ -21,7 +21,7 @@ public ReplaceToManyRelationshipTests(ExampleIntegrationTestContext(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/UpdateToOneRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/UpdateToOneRelationshipTests.cs index 64dbe765b1..84c8ee134d 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/UpdateToOneRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Relationships/UpdateToOneRelationshipTests.cs @@ -21,9 +21,9 @@ public UpdateToOneRelationshipTests(ExampleIntegrationTestContext(); - testContext.AddController(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/ReplaceToManyRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/ReplaceToManyRelationshipTests.cs index 5c367f7813..8b0f453e11 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/ReplaceToManyRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/ReplaceToManyRelationshipTests.cs @@ -22,7 +22,7 @@ public ReplaceToManyRelationshipTests(ExampleIntegrationTestContext(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateResourceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateResourceTests.cs index 5d8dd382fa..5e3ef5e8d2 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateResourceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateResourceTests.cs @@ -24,10 +24,10 @@ public UpdateResourceTests(ExampleIntegrationTestContext(); - testContext.AddController(); - testContext.AddController(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); + testContext.UseController(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateToOneRelationshipTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateToOneRelationshipTests.cs index 4522b75a4b..3494ae303f 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateToOneRelationshipTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ReadWrite/Updating/Resources/UpdateToOneRelationshipTests.cs @@ -21,9 +21,9 @@ public UpdateToOneRelationshipTests(ExampleIntegrationTestContext(); - testContext.AddController(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RequiredRelationships/DefaultBehaviorTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RequiredRelationships/DefaultBehaviorTests.cs index a6068f0176..33960a261f 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RequiredRelationships/DefaultBehaviorTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RequiredRelationships/DefaultBehaviorTests.cs @@ -21,11 +21,11 @@ public DefaultBehaviorTests(ExampleIntegrationTestContext(); + testContext.UseController(); ; - testContext.AddController(); + testContext.UseController(); ; - testContext.AddController(); + testContext.UseController(); ; var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService(); diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceConstructorInjection/ResourceInjectionTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceConstructorInjection/ResourceInjectionTests.cs index eb0df16882..1ccbdd5469 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceConstructorInjection/ResourceInjectionTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceConstructorInjection/ResourceInjectionTests.cs @@ -24,8 +24,8 @@ public ResourceInjectionTests(ExampleIntegrationTestContext(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); testContext.ConfigureServicesBeforeStartup(services => { diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceDefinitions/ResourceDefinitionQueryCallbackTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceDefinitions/ResourceDefinitionQueryCallbackTests.cs index 31f542cf25..204154325a 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceDefinitions/ResourceDefinitionQueryCallbackTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceDefinitions/ResourceDefinitionQueryCallbackTests.cs @@ -23,7 +23,7 @@ public ResourceDefinitionQueryCallbackTests(ExampleIntegrationTestContext(); + testContext.UseController(); testContext.ConfigureServicesAfterStartup(services => { diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceHooks/ResourceHookTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceHooks/ResourceHookTests.cs index 5226deb73a..374ab674eb 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceHooks/ResourceHookTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceHooks/ResourceHookTests.cs @@ -30,12 +30,12 @@ public ResourceHookTests(ExampleIntegrationTestContext(); - testContext.AddController(); - testContext.AddController(); - testContext.AddController(); - testContext.AddController(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); + testContext.UseController(); + testContext.UseController(); + testContext.UseController(); + testContext.UseController(); testContext.ConfigureServicesAfterStartup(services => { diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceInheritance/InheritanceTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceInheritance/InheritanceTests.cs index 1e93c2befd..ae13322c7f 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceInheritance/InheritanceTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ResourceInheritance/InheritanceTests.cs @@ -21,7 +21,7 @@ public InheritanceTests(ExampleIntegrationTestContext(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/DisableQueryStringTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/DisableQueryStringTests.cs index a668baa6b1..c959863bca 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/DisableQueryStringTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/DisableQueryStringTests.cs @@ -19,8 +19,8 @@ public DisableQueryStringTests(ExampleIntegrationTestContext(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); testContext.ConfigureServicesAfterStartup(services => { diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/HttpReadOnlyTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/HttpReadOnlyTests.cs index 5b34c381ae..ae1534ecdb 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/HttpReadOnlyTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/HttpReadOnlyTests.cs @@ -18,7 +18,7 @@ public HttpReadOnlyTests(ExampleIntegrationTestContext(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpDeleteTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpDeleteTests.cs index b51b5350bb..8a0015329b 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpDeleteTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpDeleteTests.cs @@ -18,7 +18,7 @@ public NoHttpDeleteTests(ExampleIntegrationTestContext(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPatchTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPatchTests.cs index cfd85e50ed..bca55551d5 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPatchTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPatchTests.cs @@ -18,7 +18,7 @@ public NoHttpPatchTests(ExampleIntegrationTestContext(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPostTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPostTests.cs index 1ad390e64f..b4036eba21 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPostTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/NoHttpPostTests.cs @@ -18,7 +18,7 @@ public NoHttpPostTests(ExampleIntegrationTestContext(); + testContext.UseController(); } [Fact] diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Serialization/SerializationTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Serialization/SerializationTests.cs index cd085ddedc..c9e5c821d7 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Serialization/SerializationTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/Serialization/SerializationTests.cs @@ -26,8 +26,8 @@ public SerializationTests(ExampleIntegrationTestContext(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); testContext.ConfigureServicesAfterStartup(services => { diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/SoftDeletion/SoftDeletionTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/SoftDeletion/SoftDeletionTests.cs index 2cf0ccbc37..8128d02d29 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/SoftDeletion/SoftDeletionTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/SoftDeletion/SoftDeletionTests.cs @@ -21,8 +21,8 @@ public SoftDeletionTests(ExampleIntegrationTestContext(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); testContext.ConfigureServicesAfterStartup(services => { diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/EmptyGuidAsKeyTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/EmptyGuidAsKeyTests.cs index 8edea56cb6..fe47d09f52 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/EmptyGuidAsKeyTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/EmptyGuidAsKeyTests.cs @@ -24,9 +24,9 @@ public EmptyGuidAsKeyTests(ExampleIntegrationTestContext(); - testContext.AddController(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); + testContext.UseController(); var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService(); options.UseRelativeLinks = true; diff --git a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/ZeroAsKeyTests.cs b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/ZeroAsKeyTests.cs index 5fe6ac3665..cf29af7672 100644 --- a/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/ZeroAsKeyTests.cs +++ b/test/JsonApiDotNetCoreExampleTests/IntegrationTests/ZeroKeys/ZeroAsKeyTests.cs @@ -23,9 +23,9 @@ public ZeroAsKeyTests(ExampleIntegrationTestContext(); - testContext.AddController(); - testContext.AddController(); + testContext.UseController(); + testContext.UseController(); + testContext.UseController(); var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService(); options.UseRelativeLinks = true; diff --git a/test/TestBuildingBlocks/BaseIntegrationTestContext.cs b/test/TestBuildingBlocks/BaseIntegrationTestContext.cs index c61c4eb453..9274e4c52a 100644 --- a/test/TestBuildingBlocks/BaseIntegrationTestContext.cs +++ b/test/TestBuildingBlocks/BaseIntegrationTestContext.cs @@ -43,7 +43,7 @@ protected BaseIntegrationTestContext() _lazyFactory = new Lazy>(CreateFactory); } - public void AddController() + public void UseController() where TController : ControllerBase { _testControllerProvider.AddController(typeof(TController)); @@ -65,10 +65,10 @@ private WebApplicationFactory CreateFactory() factory.ConfigureServicesBeforeStartup(services => { - services.UseControllers(_testControllerProvider); - _beforeServicesConfiguration?.Invoke(services); + services.ReplaceControllers(_testControllerProvider); + services.AddDbContext(options => { options.UseNpgsql(dbConnectionString, postgresOptions => postgresOptions.SetPostgresVersion(new Version(9, 6))); diff --git a/test/TestBuildingBlocks/ServiceCollectionExtensions.cs b/test/TestBuildingBlocks/ServiceCollectionExtensions.cs index 92df0a2b47..d3ede9b68c 100644 --- a/test/TestBuildingBlocks/ServiceCollectionExtensions.cs +++ b/test/TestBuildingBlocks/ServiceCollectionExtensions.cs @@ -9,7 +9,7 @@ namespace TestBuildingBlocks { internal static class ServiceCollectionExtensions { - public static void UseControllers(this IServiceCollection services, TestControllerProvider provider) + public static void ReplaceControllers(this IServiceCollection services, TestControllerProvider provider) { ArgumentGuard.NotNull(services, nameof(services)); diff --git a/test/TestBuildingBlocks/TestControllerProvider.cs b/test/TestBuildingBlocks/TestControllerProvider.cs index 169dbc8751..f95427dc32 100644 --- a/test/TestBuildingBlocks/TestControllerProvider.cs +++ b/test/TestBuildingBlocks/TestControllerProvider.cs @@ -7,7 +7,7 @@ namespace TestBuildingBlocks { internal sealed class TestControllerProvider : ControllerFeatureProvider { - private readonly IList _allowedControllerTypes = new List(); + private readonly ISet _allowedControllerTypes = new HashSet(); internal ISet ControllerAssemblies { get; } = new HashSet(); public void AddController(Type controller) From b4f20c50da9ab8d3a72718af585be55fa021aae9 Mon Sep 17 00:00:00 2001 From: maurei Date: Thu, 18 Mar 2021 10:55:53 +0100 Subject: [PATCH 18/18] line break --- test/TestBuildingBlocks/TestControllerProvider.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/test/TestBuildingBlocks/TestControllerProvider.cs b/test/TestBuildingBlocks/TestControllerProvider.cs index f95427dc32..d8790269ef 100644 --- a/test/TestBuildingBlocks/TestControllerProvider.cs +++ b/test/TestBuildingBlocks/TestControllerProvider.cs @@ -8,6 +8,7 @@ namespace TestBuildingBlocks internal sealed class TestControllerProvider : ControllerFeatureProvider { private readonly ISet _allowedControllerTypes = new HashSet(); + internal ISet ControllerAssemblies { get; } = new HashSet(); public void AddController(Type controller)