From f3660369884a4f6d410f8fb3f43eed0b10721e10 Mon Sep 17 00:00:00 2001 From: "jack.lewis" Date: Thu, 28 Nov 2024 15:39:40 +0000 Subject: [PATCH] Stop using shared CollectionDefinition.cs --- .../API.Tests/Helpers/PresentationContextXTests.cs | 2 +- .../API.Tests/Integration/DeleteCollectionTests.cs | 3 +-- .../API.Tests/Integration/DeleteManifestTests.cs | 3 +-- .../API.Tests/Integration/GetCollectionTests.cs | 3 +-- .../API.Tests/Integration/GetManifestTests.cs | 3 +-- .../Infrastructure/CollectionDefinition.cs | 4 +++- .../API.Tests/Integration/ModifyCollectionTests.cs | 3 +-- .../Integration/ModifyManifestCreateTests.cs | 3 +-- .../Integration/ModifyManifestUpdateTests.cs | 3 +-- .../CustomerCreationMessageHandlerTests.cs | 4 ++-- .../infrastructure/CollectionDefinition.cs | 12 ++++++++++++ 11 files changed, 25 insertions(+), 18 deletions(-) rename src/IIIFPresentation/{Test.Helpers => API.Tests}/Integration/Infrastructure/CollectionDefinition.cs (84%) create mode 100644 src/IIIFPresentation/BackgroundHandler.Tests/infrastructure/CollectionDefinition.cs diff --git a/src/IIIFPresentation/API.Tests/Helpers/PresentationContextXTests.cs b/src/IIIFPresentation/API.Tests/Helpers/PresentationContextXTests.cs index 7b3c5716..2b164e33 100644 --- a/src/IIIFPresentation/API.Tests/Helpers/PresentationContextXTests.cs +++ b/src/IIIFPresentation/API.Tests/Helpers/PresentationContextXTests.cs @@ -1,7 +1,7 @@ using API.Features.Storage.Helpers; +using API.Tests.Integration.Infrastructure; using Repository; using Test.Helpers.Integration; -using Test.Helpers.Integration.Infrastructure; namespace API.Tests.Helpers; diff --git a/src/IIIFPresentation/API.Tests/Integration/DeleteCollectionTests.cs b/src/IIIFPresentation/API.Tests/Integration/DeleteCollectionTests.cs index ef80b827..78b60c89 100644 --- a/src/IIIFPresentation/API.Tests/Integration/DeleteCollectionTests.cs +++ b/src/IIIFPresentation/API.Tests/Integration/DeleteCollectionTests.cs @@ -10,13 +10,12 @@ using Repository; using Test.Helpers.Helpers; using Test.Helpers.Integration; -using Test.Helpers.Integration.Infrastructure; namespace API.Tests.Integration; [Trait("Category", "Integration")] [Collection(CollectionDefinitions.StorageCollection.CollectionName)] -public class DeleteCollectionTests : IClassFixture>, IClassFixture +public class DeleteCollectionTests : IClassFixture> { private readonly HttpClient httpClient; diff --git a/src/IIIFPresentation/API.Tests/Integration/DeleteManifestTests.cs b/src/IIIFPresentation/API.Tests/Integration/DeleteManifestTests.cs index 33b866e6..97b1f2ec 100644 --- a/src/IIIFPresentation/API.Tests/Integration/DeleteManifestTests.cs +++ b/src/IIIFPresentation/API.Tests/Integration/DeleteManifestTests.cs @@ -11,13 +11,12 @@ using Repository; using Test.Helpers.Helpers; using Test.Helpers.Integration; -using Test.Helpers.Integration.Infrastructure; namespace API.Tests.Integration; [Trait("Category", "Integration")] [Collection(CollectionDefinitions.StorageCollection.CollectionName)] -public class DeleteManifestTests : IClassFixture>, IClassFixture +public class DeleteManifestTests : IClassFixture> { private readonly HttpClient httpClient; private readonly PresentationContext dbContext; diff --git a/src/IIIFPresentation/API.Tests/Integration/GetCollectionTests.cs b/src/IIIFPresentation/API.Tests/Integration/GetCollectionTests.cs index 5fe132f5..39937ae2 100644 --- a/src/IIIFPresentation/API.Tests/Integration/GetCollectionTests.cs +++ b/src/IIIFPresentation/API.Tests/Integration/GetCollectionTests.cs @@ -7,13 +7,12 @@ using Models.API.Collection; using Test.Helpers.Helpers; using Test.Helpers.Integration; -using Test.Helpers.Integration.Infrastructure; namespace API.Tests.Integration; [Trait("Category", "Integration")] [Collection(CollectionDefinitions.StorageCollection.CollectionName)] -public class GetCollectionTests : IClassFixture>, IClassFixture +public class GetCollectionTests : IClassFixture> { private readonly HttpClient httpClient; private const int TotalDatabaseChildItems = 4; diff --git a/src/IIIFPresentation/API.Tests/Integration/GetManifestTests.cs b/src/IIIFPresentation/API.Tests/Integration/GetManifestTests.cs index 7689dac6..2fe453bc 100644 --- a/src/IIIFPresentation/API.Tests/Integration/GetManifestTests.cs +++ b/src/IIIFPresentation/API.Tests/Integration/GetManifestTests.cs @@ -7,13 +7,12 @@ using Models.API.Manifest; using Microsoft.Net.Http.Headers; using Test.Helpers.Integration; -using Test.Helpers.Integration.Infrastructure; namespace API.Tests.Integration; [Trait("Category", "Integration")] [Collection(CollectionDefinitions.StorageCollection.CollectionName)] -public class GetManifestTests : IClassFixture>, IClassFixture +public class GetManifestTests : IClassFixture> { private readonly HttpClient httpClient; diff --git a/src/IIIFPresentation/Test.Helpers/Integration/Infrastructure/CollectionDefinition.cs b/src/IIIFPresentation/API.Tests/Integration/Infrastructure/CollectionDefinition.cs similarity index 84% rename from src/IIIFPresentation/Test.Helpers/Integration/Infrastructure/CollectionDefinition.cs rename to src/IIIFPresentation/API.Tests/Integration/Infrastructure/CollectionDefinition.cs index 1334dca0..aec5a1c7 100644 --- a/src/IIIFPresentation/Test.Helpers/Integration/Infrastructure/CollectionDefinition.cs +++ b/src/IIIFPresentation/API.Tests/Integration/Infrastructure/CollectionDefinition.cs @@ -1,4 +1,6 @@ -namespace Test.Helpers.Integration.Infrastructure; +using Test.Helpers.Integration; + +namespace API.Tests.Integration.Infrastructure; public class CollectionDefinitions { diff --git a/src/IIIFPresentation/API.Tests/Integration/ModifyCollectionTests.cs b/src/IIIFPresentation/API.Tests/Integration/ModifyCollectionTests.cs index 88ab1677..d6098e9d 100644 --- a/src/IIIFPresentation/API.Tests/Integration/ModifyCollectionTests.cs +++ b/src/IIIFPresentation/API.Tests/Integration/ModifyCollectionTests.cs @@ -23,14 +23,13 @@ using Repository; using Test.Helpers.Helpers; using Test.Helpers.Integration; -using Test.Helpers.Integration.Infrastructure; using JsonSerializer = System.Text.Json.JsonSerializer; namespace API.Tests.Integration; [Trait("Category", "Integration")] [Collection(CollectionDefinitions.StorageCollection.CollectionName)] -public class ModifyCollectionTests : IClassFixture>, IClassFixture +public class ModifyCollectionTests : IClassFixture> { private readonly HttpClient httpClient; diff --git a/src/IIIFPresentation/API.Tests/Integration/ModifyManifestCreateTests.cs b/src/IIIFPresentation/API.Tests/Integration/ModifyManifestCreateTests.cs index 7bd2f1a5..f7575773 100644 --- a/src/IIIFPresentation/API.Tests/Integration/ModifyManifestCreateTests.cs +++ b/src/IIIFPresentation/API.Tests/Integration/ModifyManifestCreateTests.cs @@ -16,13 +16,12 @@ using Test.Helpers; using Test.Helpers.Helpers; using Test.Helpers.Integration; -using Test.Helpers.Integration.Infrastructure; namespace API.Tests.Integration; [Trait("Category", "Integration")] [Collection(CollectionDefinitions.StorageCollection.CollectionName)] -public class ModifyManifestCreateTests : IClassFixture>, IClassFixture +public class ModifyManifestCreateTests : IClassFixture> { private readonly HttpClient httpClient; private readonly PresentationContext dbContext; diff --git a/src/IIIFPresentation/API.Tests/Integration/ModifyManifestUpdateTests.cs b/src/IIIFPresentation/API.Tests/Integration/ModifyManifestUpdateTests.cs index 0078fed5..ae72ec37 100644 --- a/src/IIIFPresentation/API.Tests/Integration/ModifyManifestUpdateTests.cs +++ b/src/IIIFPresentation/API.Tests/Integration/ModifyManifestUpdateTests.cs @@ -16,13 +16,12 @@ using Repository; using Test.Helpers.Helpers; using Test.Helpers.Integration; -using Test.Helpers.Integration.Infrastructure; namespace API.Tests.Integration; [Trait("Category", "Integration")] [Collection(CollectionDefinitions.StorageCollection.CollectionName)] -public class ModifyManifestUpdateTests : IClassFixture>, IClassFixture +public class ModifyManifestUpdateTests : IClassFixture> { private readonly HttpClient httpClient; private readonly PresentationContext dbContext; diff --git a/src/IIIFPresentation/BackgroundHandler.Tests/CustomerCreation/CustomerCreationMessageHandlerTests.cs b/src/IIIFPresentation/BackgroundHandler.Tests/CustomerCreation/CustomerCreationMessageHandlerTests.cs index 65ded8a9..23f73ec6 100644 --- a/src/IIIFPresentation/BackgroundHandler.Tests/CustomerCreation/CustomerCreationMessageHandlerTests.cs +++ b/src/IIIFPresentation/BackgroundHandler.Tests/CustomerCreation/CustomerCreationMessageHandlerTests.cs @@ -1,13 +1,13 @@ using AWS.SQS; using BackgroundHandler.CustomerCreation; +using BackgroundHandler.Tests.infrastructure; using FluentAssertions; using Microsoft.Extensions.Logging.Abstractions; using Models.Database.General; using Repository; using Test.Helpers.Integration; -using Test.Helpers.Integration.Infrastructure; -namespace BackgroundServices.Tests.CustomerCreation; +namespace BackgroundHandler.Tests.CustomerCreation; [Trait("Category", "Database")] [Collection(CollectionDefinitions.DatabaseCollection.CollectionName)] diff --git a/src/IIIFPresentation/BackgroundHandler.Tests/infrastructure/CollectionDefinition.cs b/src/IIIFPresentation/BackgroundHandler.Tests/infrastructure/CollectionDefinition.cs new file mode 100644 index 00000000..f6a1242d --- /dev/null +++ b/src/IIIFPresentation/BackgroundHandler.Tests/infrastructure/CollectionDefinition.cs @@ -0,0 +1,12 @@ +using Test.Helpers.Integration; + +namespace BackgroundHandler.Tests.infrastructure; + +public class CollectionDefinitions +{ + [CollectionDefinition(CollectionName)] + public class DatabaseCollection : ICollectionFixture + { + public const string CollectionName = "Database Collection"; + } +} \ No newline at end of file