From b184815548d809f693fc33927a2f532adebdb199 Mon Sep 17 00:00:00 2001 From: Michael Staib Date: Thu, 19 Dec 2024 23:34:16 +0100 Subject: [PATCH] Added CookieCrumble Module Source Generator (#7851) --- src/CookieCrumble/CookieCrumble.sln | 7 + .../CookieCrumble.Analyzers.csproj | 25 ++++ .../Properties/launchSettings.json | 9 ++ .../SnapshotModuleGenerator.cs | 139 ++++++++++++++++++ .../CookieCrumbleFusion.cs | 9 +- .../CookieCrumbleHotChocolate.cs | 19 +-- .../CookieCrumble.TUnit/CookieCrumbleTUnit.cs | 8 +- .../CookieCrumble.Xunit/CookieCrumbleXunit.cs | 8 +- .../CookieCrumble.Xunit3.csproj | 6 + .../CookieCrumbleXunit3.cs | 8 +- .../src/CookieCrumble/DisposableSnapshot.cs | 8 + .../Formatters/SnapshotValueFormatter.cs | 3 +- .../src/CookieCrumble/ISnapshotModule.cs | 32 ++++ .../src/CookieCrumble/ISnapshotSegment.cs | 3 + .../src/CookieCrumble/MarkdownLanguages.cs | 1 + .../src/CookieCrumble/Snapshot.cs | 34 +---- .../src/CookieCrumble/SnapshotValue.cs | 23 +++ .../{ => Utilities}/FileResource.cs | 0 .../{ => Utilities}/QueryInfo.cs | 0 .../{ => Utilities}/TestEnvironment.cs | 0 .../CookieCrumble.Tests.csproj | 1 + .../test/Core.Tests/ModuleInitializer.cs | 12 -- src/GreenDonut/test/Directory.Build.props | 1 + .../ModuleInitializer.cs | 13 -- .../test/Directory.Build.props | 1 + .../ModuleInitializer.cs | 13 -- .../ModuleInitializer.cs | 12 -- .../AspNetCore.Tests/ModuleInitializer.cs | 13 -- .../AspNetCore/test/Directory.Build.props | 1 + .../Transport.Http.Tests/ModuleInitializer.cs | 13 -- .../ModuleInitializer.cs | 12 -- .../test/Caching.Tests/ModuleInitializer.cs | 13 -- .../Caching/test/Directory.Build.props | 1 + .../Abstractions.Tests/ModuleInitializer.cs | 13 -- .../Authorization.Tests/ModuleInitializer.cs | 13 -- .../Core/test/Directory.Build.props | 1 + .../test/Execution.Tests/ModuleInitializer.cs | 13 -- .../HotChocolate.Fetching.Tests.csproj | 2 +- .../test/Fetching.Tests/ModuleInitializer.cs | 13 -- .../Subscriptions.Tests/ModuleInitializer.cs | 13 -- .../ModuleInitializer.cs | 13 -- .../ModuleInitializer.cs | 13 -- .../Types.Json.Tests/ModuleInitializer.cs | 13 -- .../ModuleInitializer.cs | 13 -- .../Types.NodaTime.Tests/ModuleInitializer.cs | 12 -- .../ModuleInitializer.cs | 13 -- .../Types.Queries.Tests/ModuleInitializer.cs | 13 -- .../Types.Records.Tests/ModuleInitializer.cs | 13 -- .../Types.Scalars.Tests/ModuleInitializer.cs | 12 -- .../test/Types.Tests/ModuleInitializer.cs | 13 -- .../Validation.Tests/ModuleInitializer.cs | 12 -- .../CostAnalysis.Tests/ModuleInitializer.cs | 13 -- .../CostAnalysis/test/Directory.Build.props | 1 + .../ModuleInitializer.cs | 12 -- .../ModuleInitializer.cs | 13 -- .../ModuleInitializer.cs | 13 -- .../ModuleInitializer.cs | 13 -- .../ModuleInitializer.cs | 13 -- .../Data.Filters.Tests/ModuleInitializer.cs | 13 -- .../ModuleInitializer.cs | 13 -- .../ModuleInitializer.cs | 13 -- .../ModuleInitializer.cs | 13 -- .../ModuleInitializer.cs | 13 -- .../Data.Sorting.Tests/ModuleInitializer.cs | 13 -- .../Data/test/Data.Tests/ModuleInitializer.cs | 13 -- .../Data/test/Directory.Build.props | 1 + .../Diagnostics.Tests/ModuleInitializer.cs | 12 -- .../Diagnostics/test/Directory.Build.props | 1 + .../Fusion-vnext/test/Directory.Build.props | 1 + .../GraphQLSnapshotValueFormatter.cs | 2 +- .../Formatters/ModuleInitializer.cs | 13 ++ .../ModuleInitializer.cs | 14 -- .../CommandLine.Tests/ModuleInitializer.cs | 13 -- .../Composition.Tests/ModuleInitializer.cs | 13 -- .../test/Core.Tests/ModuleInitializer.cs | 14 -- .../Fusion/test/Directory.Build.props | 1 + .../Language/test/Directory.Build.props | 1 + .../ModuleInitializer.cs | 12 -- .../test/Language.Tests/ModuleInitializer.cs | 13 -- .../Language.Web.Tests/ModuleInitializer.cs | 12 -- .../ModuleInitializer.cs | 13 -- .../ModuleInitializer.cs | 13 -- .../Marten/test/Directory.Build.props | 1 + .../ModuleInitializer.cs | 13 -- .../ModuleInitializer.cs | 12 -- .../ModuleInitializer.cs | 12 -- .../ModuleInitializer.cs | 12 -- .../MongoDb/test/Directory.Build.props | 1 + .../test/Types.MongoDb/ModuleInitializer.cs | 13 -- .../OpenApi/test/Directory.Build.props | 1 + .../ModuleInitializer.cs | 13 -- .../Pagination/test/Directory.Build.props | 1 + .../ModuleInitializer.cs | 13 -- .../test/Directory.Build.props | 1 + .../ModuleInitializer.cs | 13 -- .../ModuleInitializer.cs | 13 -- .../ModuleInitializer.cs | 12 -- .../ModuleInitializer.cs | 13 -- .../ModuleInitializer.cs | 13 -- .../ModuleInitializer.cs | 12 -- .../ModuleInitializer.cs | 12 -- .../ModuleInitializer.cs | 13 -- .../Data.Raven.Tests/ModuleInitializer.cs | 13 -- .../Raven/test/Directory.Build.props | 1 + .../Skimmed/test/Directory.Build.props | 1 + .../test/Skimmed.Tests/ModuleInitializer.cs | 12 -- .../ModuleInitializer.cs | 12 -- .../ModuleInitializer.cs | 12 -- .../test/Data.Tests/ModuleInitializer.cs | 12 -- .../Spatial/test/Directory.Build.props | 1 + .../test/Types.Tests/ModuleInitializer.cs | 13 -- .../Utilities/test/Directory.Build.props | 1 + .../ModuleInitializer.cs | 12 -- .../test/Core.Tests/ModuleInitializer.cs | 12 -- .../Core.Tests/OperationResultBuilderTests.cs | 1 + .../Client/test/Directory.Build.props | 1 + .../Transport.Http.Tests/ModuleInitializer.cs | 12 -- .../ModuleInitializer.cs | 12 -- .../ModuleInitializer.cs | 12 -- .../Configuration.Tests/FileContentsTests.cs | 1 + .../Configuration.Tests/ModuleInitializer.cs | 12 -- .../Tooling/test/Directory.Build.props | 1 + 122 files changed, 323 insertions(+), 999 deletions(-) create mode 100644 src/CookieCrumble/src/CookieCrumble.Analyzers/CookieCrumble.Analyzers.csproj create mode 100644 src/CookieCrumble/src/CookieCrumble.Analyzers/Properties/launchSettings.json create mode 100644 src/CookieCrumble/src/CookieCrumble.Analyzers/SnapshotModuleGenerator.cs create mode 100644 src/CookieCrumble/src/CookieCrumble/DisposableSnapshot.cs create mode 100644 src/CookieCrumble/src/CookieCrumble/ISnapshotModule.cs create mode 100644 src/CookieCrumble/src/CookieCrumble/SnapshotValue.cs rename src/CookieCrumble/src/CookieCrumble/{ => Utilities}/FileResource.cs (100%) rename src/CookieCrumble/src/CookieCrumble/{ => Utilities}/QueryInfo.cs (100%) rename src/CookieCrumble/src/CookieCrumble/{ => Utilities}/TestEnvironment.cs (100%) delete mode 100644 src/GreenDonut/test/Core.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/AspNetCore/test/AspNetCore.Authorization.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/AspNetCore/test/AspNetCore.CommandLine.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/AspNetCore/test/AspNetCore.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/AspNetCore/test/Transport.Http.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/AspNetCore/test/Transport.Sockets.Client.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Caching/test/Caching.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Core/test/Abstractions.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Core/test/Authorization.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Core/test/Execution.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Core/test/Fetching.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Core/test/Subscriptions.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Core/test/Types.Analyzers.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Core/test/Types.CursorPagination.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Core/test/Types.Json.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Core/test/Types.Mutations.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Core/test/Types.NodaTime.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Core/test/Types.OffsetPagination.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Core/test/Types.Queries.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Core/test/Types.Records.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Core/test/Types.Scalars.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Core/test/Types.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Core/test/Validation.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Data/test/Data.AutoMapper.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Data/test/Data.EntityFramework.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Data/test/Data.Filters.InMemory.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Data/test/Data.Filters.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Data/test/Data.Projections.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Data/test/Data.Sorting.InMemory.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Data/test/Data.Sorting.SqlLite.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Data/test/Data.Sorting.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Data/test/Data.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Diagnostics/test/Diagnostics.Tests/ModuleInitializer.cs create mode 100644 src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/Formatters/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Fusion/test/CommandLine.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Fusion/test/Composition.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Fusion/test/Core.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Language/test/Language.SyntaxTree.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Language/test/Language.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Language/test/Language.Web.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Marten/test/Data.Marten.Filters.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Marten/test/Data.Marten.Sorting.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/MongoDb/test/Data.MongoDb.Paging.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/MongoDb/test/Data.MongoDb.Projections.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/MongoDb/test/Types.MongoDb/ModuleInitializer.cs delete mode 100644 src/HotChocolate/OpenApi/test/HotChocolate.OpenApi.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Pagination/test/Pagination.EntityFramework.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/PersistedOperations/test/PersistedOperations.AzureBlobStorage.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/PersistedOperations/test/PersistedOperations.FileSystem.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/PersistedOperations/test/PersistedOperations.InMemory.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/PersistedOperations/test/PersistedOperations.Redis.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Raven/test/Data.Raven.Filters.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Raven/test/Data.Raven.Paging.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Raven/test/Data.Raven.Projections.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Raven/test/Data.Raven.Sorting.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Raven/test/Data.Raven.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Skimmed/test/Skimmed.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Spatial/test/Data.Projections.SqlServer.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Spatial/test/Data.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Spatial/test/Types.Tests/ModuleInitializer.cs delete mode 100644 src/HotChocolate/Utilities/test/Utilities.Introspection.Tests/ModuleInitializer.cs delete mode 100644 src/StrawberryShake/Client/test/Core.Tests/ModuleInitializer.cs delete mode 100644 src/StrawberryShake/Client/test/Transport.Http.Tests/ModuleInitializer.cs delete mode 100644 src/StrawberryShake/Client/test/Transport.InMemory.Tests/ModuleInitializer.cs delete mode 100644 src/StrawberryShake/Client/test/Transport.WebSocket.Tests/ModuleInitializer.cs delete mode 100644 src/StrawberryShake/Tooling/test/Configuration.Tests/ModuleInitializer.cs diff --git a/src/CookieCrumble/CookieCrumble.sln b/src/CookieCrumble/CookieCrumble.sln index 78d622a8638..b4d126de5b6 100644 --- a/src/CookieCrumble/CookieCrumble.sln +++ b/src/CookieCrumble/CookieCrumble.sln @@ -21,6 +21,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{EB8F1D90-6 EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CookieCrumble.Tests", "test\CookieCrumble.Tests\CookieCrumble.Tests.csproj", "{844E7501-7ED6-4548-8E99-D8E50D4F39A4}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CookieCrumble.Analyzers", "src\CookieCrumble.Analyzers\CookieCrumble.Analyzers.csproj", "{F9595524-7EB4-449D-9A13-1C85B13EEE6F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -58,6 +60,10 @@ Global {844E7501-7ED6-4548-8E99-D8E50D4F39A4}.Debug|Any CPU.Build.0 = Debug|Any CPU {844E7501-7ED6-4548-8E99-D8E50D4F39A4}.Release|Any CPU.ActiveCfg = Release|Any CPU {844E7501-7ED6-4548-8E99-D8E50D4F39A4}.Release|Any CPU.Build.0 = Release|Any CPU + {F9595524-7EB4-449D-9A13-1C85B13EEE6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F9595524-7EB4-449D-9A13-1C85B13EEE6F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F9595524-7EB4-449D-9A13-1C85B13EEE6F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F9595524-7EB4-449D-9A13-1C85B13EEE6F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution {8E71FA9B-8352-4675-A9B4-A934E40AF9E0} = {2465C122-714C-4D0A-A24D-D9C22A25D73A} @@ -67,5 +73,6 @@ Global {CEE25A68-69B5-4CFD-9C35-E82736B1E205} = {2465C122-714C-4D0A-A24D-D9C22A25D73A} {20ED55B7-E3E7-4CDB-A3CE-87BCB42A4264} = {2465C122-714C-4D0A-A24D-D9C22A25D73A} {844E7501-7ED6-4548-8E99-D8E50D4F39A4} = {EB8F1D90-60D6-48FA-9744-D4180A0E4AC0} + {F9595524-7EB4-449D-9A13-1C85B13EEE6F} = {2465C122-714C-4D0A-A24D-D9C22A25D73A} EndGlobalSection EndGlobal diff --git a/src/CookieCrumble/src/CookieCrumble.Analyzers/CookieCrumble.Analyzers.csproj b/src/CookieCrumble/src/CookieCrumble.Analyzers/CookieCrumble.Analyzers.csproj new file mode 100644 index 00000000000..4920030d98f --- /dev/null +++ b/src/CookieCrumble/src/CookieCrumble.Analyzers/CookieCrumble.Analyzers.csproj @@ -0,0 +1,25 @@ + + + + netstandard2.0 + netstandard2.0 + false + false + true + false + + + + CookieCrumble.Analyzers + CookieCrumble.Analyzers + CookieCrumble.Analyzers + This package provides source generators for CookieCrumble. + + + + + + + + + diff --git a/src/CookieCrumble/src/CookieCrumble.Analyzers/Properties/launchSettings.json b/src/CookieCrumble/src/CookieCrumble.Analyzers/Properties/launchSettings.json new file mode 100644 index 00000000000..37a257844d7 --- /dev/null +++ b/src/CookieCrumble/src/CookieCrumble.Analyzers/Properties/launchSettings.json @@ -0,0 +1,9 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "profiles": { + "Generators": { + "commandName": "DebugRoslynComponent", + "targetProject": "../../test/CookieCrumble.Tests/CookieCrumble.Tests.csproj" + } + } +} diff --git a/src/CookieCrumble/src/CookieCrumble.Analyzers/SnapshotModuleGenerator.cs b/src/CookieCrumble/src/CookieCrumble.Analyzers/SnapshotModuleGenerator.cs new file mode 100644 index 00000000000..33ee0af575f --- /dev/null +++ b/src/CookieCrumble/src/CookieCrumble.Analyzers/SnapshotModuleGenerator.cs @@ -0,0 +1,139 @@ +using System.Collections.Immutable; +using System.Text; +using Microsoft.CodeAnalysis; + +namespace CookieCrumble.Analyzers; + +[Generator] +public class SnapshotModuleGenerator : IIncrementalGenerator +{ + public void Initialize(IncrementalGeneratorInitializationContext context) + { + var rootNamespaceProvider = context.AnalyzerConfigOptionsProvider + .Select((options, _) => + { + options.GlobalOptions.TryGetValue("build_property.RootNamespace", out var rootNamespace); + return string.IsNullOrWhiteSpace(rootNamespace) ? "CookieCrumble" : rootNamespace; + }); + + var compilationProvider = context.CompilationProvider; + + var providerInterfaceProvider = compilationProvider + .Select((comp, _) => comp.GetTypeByMetadataName("CookieCrumble.ISnapshotModule")); + + var providerTypes = compilationProvider + .Combine(providerInterfaceProvider) + .SelectMany((tuple, _) => + { + var (comp, providerInterface) = tuple; + if (providerInterface is null) + { + return ImmutableArray.Empty; + } + + var providers = GetProviderTypes(comp.GlobalNamespace, providerInterface); + return providers.ToImmutableArray(); + }) + .Collect(); + + var combined = providerTypes.Combine(rootNamespaceProvider); + + context.RegisterSourceOutput(combined, (spc, tuple) => + { + var (types, rootNamespace) = tuple; + var source = GenerateModuleInitializerClass(types, rootNamespace); + spc.AddSource("ModuleInitializer.g.cs", source); + }); + } + + private static IEnumerable GetProviderTypes( + INamespaceSymbol namespaceSymbol, + INamedTypeSymbol providerInterface) + { + foreach (var member in namespaceSymbol.GetMembers()) + { + if (member is INamespaceSymbol ns) + { + foreach (var nestedType in GetProviderTypes(ns, providerInterface)) + { + if (IsProvider(nestedType, providerInterface)) + { + yield return nestedType; + } + } + } + else if (member is INamedTypeSymbol type) + { + if (IsProvider(type, providerInterface)) + { + yield return type; + } + + foreach (var nested in type.GetTypeMembers()) + { + foreach (var nestedType in GetAllNamedTypes(nested)) + { + if (IsProvider(nestedType, providerInterface)) + { + yield return nestedType; + } + } + } + } + } + + static bool IsProvider(INamedTypeSymbol type, INamedTypeSymbol providerInterface) + => type.TypeKind == TypeKind.Class + && !type.IsAbstract + && type.AllInterfaces.Contains(providerInterface, SymbolEqualityComparer.Default); + } + + private static IEnumerable GetAllNamedTypes(INamedTypeSymbol typeSymbol) + { + yield return typeSymbol; + + foreach (var nested in typeSymbol.GetTypeMembers()) + { + foreach (var nestedType in GetAllNamedTypes(nested)) + { + yield return nestedType; + } + } + } + + private static string GenerateModuleInitializerClass( + ImmutableArray providerTypes, + string? rootNamespace) + { + rootNamespace ??= "CookieCrumble"; + + var sb = new StringBuilder(); + sb.AppendLine("// "); + sb.AppendLine("using System;"); + sb.AppendLine("using System.Runtime.CompilerServices;"); + sb.AppendLine(); + sb.AppendLine($"namespace {rootNamespace}"); + sb.AppendLine("{"); + sb.AppendLine(" internal static partial class ModuleInitializer"); + sb.AppendLine(" {"); + sb.AppendLine(" [ModuleInitializer]"); + sb.AppendLine(" public static void Initialize()"); + sb.AppendLine(" {"); + + var count = 1; + foreach (var t in providerTypes) + { + var providerName = "provider" + count++; + sb.AppendLine($" var {providerName} = new {t.ToDisplayString(format: SymbolDisplayFormat.FullyQualifiedFormat)}();"); + sb.AppendLine($" {providerName}.Initialize();"); + } + + sb.AppendLine(" OnInitialize(global::CookieCrumble.Snapshot.RegisterFormatter);"); + sb.AppendLine(" }"); + sb.AppendLine(); + sb.AppendLine(" static partial void OnInitialize(global::System.Action register);"); + sb.AppendLine(" }"); + sb.AppendLine("}"); + return sb.ToString(); + } +} diff --git a/src/CookieCrumble/src/CookieCrumble.Fusion/CookieCrumbleFusion.cs b/src/CookieCrumble/src/CookieCrumble.Fusion/CookieCrumbleFusion.cs index ac00f245992..2ffb2af4d2d 100644 --- a/src/CookieCrumble/src/CookieCrumble.Fusion/CookieCrumbleFusion.cs +++ b/src/CookieCrumble/src/CookieCrumble.Fusion/CookieCrumbleFusion.cs @@ -1,11 +1,12 @@ -using CookieCrumble.Fusion.Formatters; +using CookieCrumble.Formatters; +using SnapshotValueFormatters = CookieCrumble.Fusion.Formatters.SnapshotValueFormatters; namespace CookieCrumble.Fusion; -public static class CookieCrumbleFusion +public class CookieCrumbleFusion : SnapshotModule { - public static void Initialize() + protected override IEnumerable CreateFormatters() { - Snapshot.TryRegisterFormatter(SnapshotValueFormatters.QueryPlan); + yield return SnapshotValueFormatters.QueryPlan; } } diff --git a/src/CookieCrumble/src/CookieCrumble.HotChocolate/CookieCrumbleHotChocolate.cs b/src/CookieCrumble/src/CookieCrumble.HotChocolate/CookieCrumbleHotChocolate.cs index 769f9d14257..c9f68404a86 100644 --- a/src/CookieCrumble/src/CookieCrumble.HotChocolate/CookieCrumbleHotChocolate.cs +++ b/src/CookieCrumble/src/CookieCrumble.HotChocolate/CookieCrumbleHotChocolate.cs @@ -1,16 +1,17 @@ -using CookieCrumble.HotChocolate.Formatters; +using CookieCrumble.Formatters; +using SnapshotValueFormatters = CookieCrumble.HotChocolate.Formatters.SnapshotValueFormatters; namespace CookieCrumble.HotChocolate; -public static class CookieCrumbleHotChocolate +public sealed class CookieCrumbleHotChocolate : SnapshotModule { - public static void Initialize() + protected override IEnumerable CreateFormatters() { - Snapshot.TryRegisterFormatter(SnapshotValueFormatters.ExecutionResult); - Snapshot.TryRegisterFormatter(SnapshotValueFormatters.GraphQL); - Snapshot.TryRegisterFormatter(SnapshotValueFormatters.GraphQLHttp); - Snapshot.TryRegisterFormatter(SnapshotValueFormatters.OperationResult); - Snapshot.TryRegisterFormatter(SnapshotValueFormatters.Schema); - Snapshot.TryRegisterFormatter(SnapshotValueFormatters.SchemaError); + yield return SnapshotValueFormatters.ExecutionResult; + yield return SnapshotValueFormatters.GraphQL; + yield return SnapshotValueFormatters.GraphQLHttp; + yield return SnapshotValueFormatters.OperationResult; + yield return SnapshotValueFormatters.Schema; + yield return SnapshotValueFormatters.SchemaError; } } diff --git a/src/CookieCrumble/src/CookieCrumble.TUnit/CookieCrumbleTUnit.cs b/src/CookieCrumble/src/CookieCrumble.TUnit/CookieCrumbleTUnit.cs index d179b0e35ad..cc190cbcb62 100644 --- a/src/CookieCrumble/src/CookieCrumble.TUnit/CookieCrumbleTUnit.cs +++ b/src/CookieCrumble/src/CookieCrumble.TUnit/CookieCrumbleTUnit.cs @@ -1,9 +1,7 @@ namespace CookieCrumble.TUnit; -public static class CookieCrumbleTUnit +public sealed class CookieCrumbleTUnit : SnapshotModule { - public static void Initialize() - { - Snapshot.RegisterTestFramework(new TUnitFramework()); - } + protected override ITestFramework TryCreateTestFramework() + => new TUnitFramework(); } diff --git a/src/CookieCrumble/src/CookieCrumble.Xunit/CookieCrumbleXunit.cs b/src/CookieCrumble/src/CookieCrumble.Xunit/CookieCrumbleXunit.cs index 5abaf224762..943599f040f 100644 --- a/src/CookieCrumble/src/CookieCrumble.Xunit/CookieCrumbleXunit.cs +++ b/src/CookieCrumble/src/CookieCrumble.Xunit/CookieCrumbleXunit.cs @@ -1,9 +1,7 @@ namespace CookieCrumble.Xunit; -public static class CookieCrumbleXunit +public class CookieCrumbleXunit : SnapshotModule { - public static void Initialize() - { - Snapshot.RegisterTestFramework(new XunitFramework()); - } + protected override ITestFramework TryCreateTestFramework() + => new XunitFramework(); } diff --git a/src/CookieCrumble/src/CookieCrumble.Xunit3/CookieCrumble.Xunit3.csproj b/src/CookieCrumble/src/CookieCrumble.Xunit3/CookieCrumble.Xunit3.csproj index b05b6918595..e6a88653bdc 100644 --- a/src/CookieCrumble/src/CookieCrumble.Xunit3/CookieCrumble.Xunit3.csproj +++ b/src/CookieCrumble/src/CookieCrumble.Xunit3/CookieCrumble.Xunit3.csproj @@ -6,6 +6,12 @@ + + + + + + diff --git a/src/CookieCrumble/src/CookieCrumble.Xunit3/CookieCrumbleXunit3.cs b/src/CookieCrumble/src/CookieCrumble.Xunit3/CookieCrumbleXunit3.cs index 525d5861841..a8ef862bb10 100644 --- a/src/CookieCrumble/src/CookieCrumble.Xunit3/CookieCrumbleXunit3.cs +++ b/src/CookieCrumble/src/CookieCrumble.Xunit3/CookieCrumbleXunit3.cs @@ -1,9 +1,7 @@ namespace CookieCrumble.Xunit3; -public static class CookieCrumbleXunit3 +public sealed class CookieCrumbleXunit3 : SnapshotModule { - public static void Initialize() - { - Snapshot.RegisterTestFramework(new Xunit3Framework()); - } + protected override ITestFramework TryCreateTestFramework() + => new Xunit3Framework(); } diff --git a/src/CookieCrumble/src/CookieCrumble/DisposableSnapshot.cs b/src/CookieCrumble/src/CookieCrumble/DisposableSnapshot.cs new file mode 100644 index 00000000000..f0990cee893 --- /dev/null +++ b/src/CookieCrumble/src/CookieCrumble/DisposableSnapshot.cs @@ -0,0 +1,8 @@ +namespace CookieCrumble; + +public sealed class DisposableSnapshot(string? postFix = null, string? extension = null) + : Snapshot(postFix, extension) + , IDisposable +{ + public void Dispose() => Match(); +} diff --git a/src/CookieCrumble/src/CookieCrumble/Formatters/SnapshotValueFormatter.cs b/src/CookieCrumble/src/CookieCrumble/Formatters/SnapshotValueFormatter.cs index 7289421bf2b..17d0db21f88 100644 --- a/src/CookieCrumble/src/CookieCrumble/Formatters/SnapshotValueFormatter.cs +++ b/src/CookieCrumble/src/CookieCrumble/Formatters/SnapshotValueFormatter.cs @@ -5,7 +5,8 @@ namespace CookieCrumble.Formatters; /// /// Formats a snapshot segment value for the snapshot file. /// -public abstract class SnapshotValueFormatter(string markdownKind = "text") : ISnapshotValueFormatter +public abstract class SnapshotValueFormatter(string markdownKind = "text") + : ISnapshotValueFormatter , IMarkdownSnapshotValueFormatter { public bool CanHandle(object? value) diff --git a/src/CookieCrumble/src/CookieCrumble/ISnapshotModule.cs b/src/CookieCrumble/src/CookieCrumble/ISnapshotModule.cs new file mode 100644 index 00000000000..1e305aa02a1 --- /dev/null +++ b/src/CookieCrumble/src/CookieCrumble/ISnapshotModule.cs @@ -0,0 +1,32 @@ +using CookieCrumble.Formatters; + +namespace CookieCrumble; + +public interface ISnapshotModule +{ + void Initialize(); +} + +public abstract class SnapshotModule : ISnapshotModule +{ + public void Initialize() + { + var framework = TryCreateTestFramework(); + if (framework is not null) + { + Snapshot.RegisterTestFramework(framework); + } + + foreach (var formatter in CreateFormatters()) + { + Snapshot.RegisterFormatter(formatter); + } + } + + protected virtual ITestFramework? TryCreateTestFramework() => null; + + protected virtual IEnumerable CreateFormatters() + { + yield break; + } +} diff --git a/src/CookieCrumble/src/CookieCrumble/ISnapshotSegment.cs b/src/CookieCrumble/src/CookieCrumble/ISnapshotSegment.cs index a57596cc1fd..6ff582d47c1 100644 --- a/src/CookieCrumble/src/CookieCrumble/ISnapshotSegment.cs +++ b/src/CookieCrumble/src/CookieCrumble/ISnapshotSegment.cs @@ -2,5 +2,8 @@ namespace CookieCrumble; internal interface ISnapshotSegment { + /// + /// Gets the name of the snapshot segment. + /// string? Name { get; } } diff --git a/src/CookieCrumble/src/CookieCrumble/MarkdownLanguages.cs b/src/CookieCrumble/src/CookieCrumble/MarkdownLanguages.cs index 5c01482d612..8a17ba3c924 100644 --- a/src/CookieCrumble/src/CookieCrumble/MarkdownLanguages.cs +++ b/src/CookieCrumble/src/CookieCrumble/MarkdownLanguages.cs @@ -5,5 +5,6 @@ public static class MarkdownLanguages public const string CSharp = "csharp"; public const string GraphQL = "graphql"; public const string Json = "json"; + public const string Yaml = "yaml"; public const string Text = "text"; } diff --git a/src/CookieCrumble/src/CookieCrumble/Snapshot.cs b/src/CookieCrumble/src/CookieCrumble/Snapshot.cs index 6a1163d39f4..e4d8f1e71be 100644 --- a/src/CookieCrumble/src/CookieCrumble/Snapshot.cs +++ b/src/CookieCrumble/src/CookieCrumble/Snapshot.cs @@ -93,7 +93,8 @@ public static void Match( snapshot.Match(); } - public static void RegisterTestFramework(ITestFramework testFramework) + public static void RegisterTestFramework( + ITestFramework testFramework) { if (testFramework is null) { @@ -219,7 +220,7 @@ private static ISnapshotValueFormatter FindSerializer(object? value) // we capture the current immutable serializer list var serializers = _formatters; - // the we iterate over the captured stack. + // we iterate over the captured stack. foreach (var serializer in serializers) { if (serializer.CanHandle(value)) @@ -696,7 +697,7 @@ private static string CreateMarkdownTitle(StackFrame[] frames) "Snapshot.Match method."); } - private static MethodBase? EvaluateAsynchronousMethodBase(MemberInfo? method) + private static MethodInfo? EvaluateAsynchronousMethodBase(MemberInfo? method) { var methodDeclaringType = method?.DeclaringType; var classDeclaringType = methodDeclaringType?.DeclaringType; @@ -729,30 +730,3 @@ private readonly struct SnapshotSegment(string? name, object? value, ISnapshotVa public ISnapshotValueFormatter Formatter { get; } = formatter; } } - -public sealed class DisposableSnapshot(string? postFix = null, string? extension = null) - : Snapshot(postFix, extension) - , IDisposable -{ - public void Dispose() => Match(); -} - -public abstract class SnapshotValue : ISnapshotSegment -{ - public abstract string? Name { get; } - - public abstract ReadOnlySpan Value { get; } - - protected virtual string MarkdownType => "text"; - - public virtual void FormatMarkdown(IBufferWriter snapshot) - { - snapshot.Append("```"); - snapshot.Append(MarkdownType); - snapshot.AppendLine(); - snapshot.Write(Value); - snapshot.AppendLine(); - snapshot.Append("```"); - snapshot.AppendLine(); - } -} diff --git a/src/CookieCrumble/src/CookieCrumble/SnapshotValue.cs b/src/CookieCrumble/src/CookieCrumble/SnapshotValue.cs new file mode 100644 index 00000000000..bee909d6be1 --- /dev/null +++ b/src/CookieCrumble/src/CookieCrumble/SnapshotValue.cs @@ -0,0 +1,23 @@ +using System.Buffers; + +namespace CookieCrumble; + +public abstract class SnapshotValue : ISnapshotSegment +{ + public abstract string? Name { get; } + + public abstract ReadOnlySpan Value { get; } + + protected virtual string MarkdownType => "text"; + + public virtual void FormatMarkdown(IBufferWriter snapshot) + { + snapshot.Append("```"); + snapshot.Append(MarkdownType); + snapshot.AppendLine(); + snapshot.Write(Value); + snapshot.AppendLine(); + snapshot.Append("```"); + snapshot.AppendLine(); + } +} diff --git a/src/CookieCrumble/src/CookieCrumble/FileResource.cs b/src/CookieCrumble/src/CookieCrumble/Utilities/FileResource.cs similarity index 100% rename from src/CookieCrumble/src/CookieCrumble/FileResource.cs rename to src/CookieCrumble/src/CookieCrumble/Utilities/FileResource.cs diff --git a/src/CookieCrumble/src/CookieCrumble/QueryInfo.cs b/src/CookieCrumble/src/CookieCrumble/Utilities/QueryInfo.cs similarity index 100% rename from src/CookieCrumble/src/CookieCrumble/QueryInfo.cs rename to src/CookieCrumble/src/CookieCrumble/Utilities/QueryInfo.cs diff --git a/src/CookieCrumble/src/CookieCrumble/TestEnvironment.cs b/src/CookieCrumble/src/CookieCrumble/Utilities/TestEnvironment.cs similarity index 100% rename from src/CookieCrumble/src/CookieCrumble/TestEnvironment.cs rename to src/CookieCrumble/src/CookieCrumble/Utilities/TestEnvironment.cs diff --git a/src/CookieCrumble/test/CookieCrumble.Tests/CookieCrumble.Tests.csproj b/src/CookieCrumble/test/CookieCrumble.Tests/CookieCrumble.Tests.csproj index 184a5075f7b..032db54808a 100644 --- a/src/CookieCrumble/test/CookieCrumble.Tests/CookieCrumble.Tests.csproj +++ b/src/CookieCrumble/test/CookieCrumble.Tests/CookieCrumble.Tests.csproj @@ -21,6 +21,7 @@ + diff --git a/src/GreenDonut/test/Core.Tests/ModuleInitializer.cs b/src/GreenDonut/test/Core.Tests/ModuleInitializer.cs deleted file mode 100644 index 28085cc59ae..00000000000 --- a/src/GreenDonut/test/Core.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace GreenDonut; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - } -} diff --git a/src/GreenDonut/test/Directory.Build.props b/src/GreenDonut/test/Directory.Build.props index 2e35995ae4c..d1e7a438af1 100644 --- a/src/GreenDonut/test/Directory.Build.props +++ b/src/GreenDonut/test/Directory.Build.props @@ -13,6 +13,7 @@ + diff --git a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/ModuleInitializer.cs b/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/ModuleInitializer.cs deleted file mode 100644 index bafe824c119..00000000000 --- a/src/HotChocolate/ApolloFederation/test/ApolloFederation.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.ApolloFederation; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/ApolloFederation/test/Directory.Build.props b/src/HotChocolate/ApolloFederation/test/Directory.Build.props index 7baf4c5ea66..7b5e79f43f8 100644 --- a/src/HotChocolate/ApolloFederation/test/Directory.Build.props +++ b/src/HotChocolate/ApolloFederation/test/Directory.Build.props @@ -16,6 +16,7 @@ + diff --git a/src/HotChocolate/AspNetCore/test/AspNetCore.Authorization.Tests/ModuleInitializer.cs b/src/HotChocolate/AspNetCore/test/AspNetCore.Authorization.Tests/ModuleInitializer.cs deleted file mode 100644 index 07575403ab1..00000000000 --- a/src/HotChocolate/AspNetCore/test/AspNetCore.Authorization.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.AspNetCore.Authorization; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/AspNetCore/test/AspNetCore.CommandLine.Tests/ModuleInitializer.cs b/src/HotChocolate/AspNetCore/test/AspNetCore.CommandLine.Tests/ModuleInitializer.cs deleted file mode 100644 index 8e7a89ae2fa..00000000000 --- a/src/HotChocolate/AspNetCore/test/AspNetCore.CommandLine.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.AspNetCore.CommandLine; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - } -} diff --git a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/ModuleInitializer.cs b/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/ModuleInitializer.cs deleted file mode 100644 index 64402bbc049..00000000000 --- a/src/HotChocolate/AspNetCore/test/AspNetCore.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.AspNetCore; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/AspNetCore/test/Directory.Build.props b/src/HotChocolate/AspNetCore/test/Directory.Build.props index 77d8561274a..b62497b326e 100644 --- a/src/HotChocolate/AspNetCore/test/Directory.Build.props +++ b/src/HotChocolate/AspNetCore/test/Directory.Build.props @@ -16,6 +16,7 @@ + diff --git a/src/HotChocolate/AspNetCore/test/Transport.Http.Tests/ModuleInitializer.cs b/src/HotChocolate/AspNetCore/test/Transport.Http.Tests/ModuleInitializer.cs deleted file mode 100644 index 71eb1dabadd..00000000000 --- a/src/HotChocolate/AspNetCore/test/Transport.Http.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Transport.Http.Tests; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/AspNetCore/test/Transport.Sockets.Client.Tests/ModuleInitializer.cs b/src/HotChocolate/AspNetCore/test/Transport.Sockets.Client.Tests/ModuleInitializer.cs deleted file mode 100644 index eda31d9c0ea..00000000000 --- a/src/HotChocolate/AspNetCore/test/Transport.Sockets.Client.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Transport.Sockets; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - } -} diff --git a/src/HotChocolate/Caching/test/Caching.Tests/ModuleInitializer.cs b/src/HotChocolate/Caching/test/Caching.Tests/ModuleInitializer.cs deleted file mode 100644 index 1839afef2c3..00000000000 --- a/src/HotChocolate/Caching/test/Caching.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Caching.Tests; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Caching/test/Directory.Build.props b/src/HotChocolate/Caching/test/Directory.Build.props index c335499b8a2..9e79eec3d0e 100644 --- a/src/HotChocolate/Caching/test/Directory.Build.props +++ b/src/HotChocolate/Caching/test/Directory.Build.props @@ -15,6 +15,7 @@ + diff --git a/src/HotChocolate/Core/test/Abstractions.Tests/ModuleInitializer.cs b/src/HotChocolate/Core/test/Abstractions.Tests/ModuleInitializer.cs deleted file mode 100644 index 863a695b53e..00000000000 --- a/src/HotChocolate/Core/test/Abstractions.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Core/test/Authorization.Tests/ModuleInitializer.cs b/src/HotChocolate/Core/test/Authorization.Tests/ModuleInitializer.cs deleted file mode 100644 index 27b2a716974..00000000000 --- a/src/HotChocolate/Core/test/Authorization.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Authorization; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Core/test/Directory.Build.props b/src/HotChocolate/Core/test/Directory.Build.props index 1bb1605e24f..6ae29fd74ba 100644 --- a/src/HotChocolate/Core/test/Directory.Build.props +++ b/src/HotChocolate/Core/test/Directory.Build.props @@ -16,6 +16,7 @@ + diff --git a/src/HotChocolate/Core/test/Execution.Tests/ModuleInitializer.cs b/src/HotChocolate/Core/test/Execution.Tests/ModuleInitializer.cs deleted file mode 100644 index 8ac28c96e3c..00000000000 --- a/src/HotChocolate/Core/test/Execution.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Execution; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Core/test/Fetching.Tests/HotChocolate.Fetching.Tests.csproj b/src/HotChocolate/Core/test/Fetching.Tests/HotChocolate.Fetching.Tests.csproj index 34fe4c41f45..cd72005885c 100644 --- a/src/HotChocolate/Core/test/Fetching.Tests/HotChocolate.Fetching.Tests.csproj +++ b/src/HotChocolate/Core/test/Fetching.Tests/HotChocolate.Fetching.Tests.csproj @@ -2,7 +2,7 @@ HotChocolate.Fetching.Tests - HotChocolate.Fetching. + HotChocolate.Fetching diff --git a/src/HotChocolate/Core/test/Fetching.Tests/ModuleInitializer.cs b/src/HotChocolate/Core/test/Fetching.Tests/ModuleInitializer.cs deleted file mode 100644 index 95149c94a6b..00000000000 --- a/src/HotChocolate/Core/test/Fetching.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Fetching; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Core/test/Subscriptions.Tests/ModuleInitializer.cs b/src/HotChocolate/Core/test/Subscriptions.Tests/ModuleInitializer.cs deleted file mode 100644 index 561e308bac8..00000000000 --- a/src/HotChocolate/Core/test/Subscriptions.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Subscriptions; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Core/test/Types.Analyzers.Tests/ModuleInitializer.cs b/src/HotChocolate/Core/test/Types.Analyzers.Tests/ModuleInitializer.cs deleted file mode 100644 index ecc2344c08f..00000000000 --- a/src/HotChocolate/Core/test/Types.Analyzers.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Types; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/ModuleInitializer.cs b/src/HotChocolate/Core/test/Types.CursorPagination.Tests/ModuleInitializer.cs deleted file mode 100644 index 2c50e63077c..00000000000 --- a/src/HotChocolate/Core/test/Types.CursorPagination.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Types.Pagination; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Core/test/Types.Json.Tests/ModuleInitializer.cs b/src/HotChocolate/Core/test/Types.Json.Tests/ModuleInitializer.cs deleted file mode 100644 index ecc2344c08f..00000000000 --- a/src/HotChocolate/Core/test/Types.Json.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Types; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/ModuleInitializer.cs b/src/HotChocolate/Core/test/Types.Mutations.Tests/ModuleInitializer.cs deleted file mode 100644 index ecc2344c08f..00000000000 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Types; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Core/test/Types.NodaTime.Tests/ModuleInitializer.cs b/src/HotChocolate/Core/test/Types.NodaTime.Tests/ModuleInitializer.cs deleted file mode 100644 index ca2e22b0d65..00000000000 --- a/src/HotChocolate/Core/test/Types.NodaTime.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Types.NodaTime.Tests; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - } -} diff --git a/src/HotChocolate/Core/test/Types.OffsetPagination.Tests/ModuleInitializer.cs b/src/HotChocolate/Core/test/Types.OffsetPagination.Tests/ModuleInitializer.cs deleted file mode 100644 index 2c50e63077c..00000000000 --- a/src/HotChocolate/Core/test/Types.OffsetPagination.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Types.Pagination; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Core/test/Types.Queries.Tests/ModuleInitializer.cs b/src/HotChocolate/Core/test/Types.Queries.Tests/ModuleInitializer.cs deleted file mode 100644 index a18781b37c8..00000000000 --- a/src/HotChocolate/Core/test/Types.Queries.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace Types.Queries.Tests; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Core/test/Types.Records.Tests/ModuleInitializer.cs b/src/HotChocolate/Core/test/Types.Records.Tests/ModuleInitializer.cs deleted file mode 100644 index ecc2344c08f..00000000000 --- a/src/HotChocolate/Core/test/Types.Records.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Types; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Core/test/Types.Scalars.Tests/ModuleInitializer.cs b/src/HotChocolate/Core/test/Types.Scalars.Tests/ModuleInitializer.cs deleted file mode 100644 index 565cd11b3d3..00000000000 --- a/src/HotChocolate/Core/test/Types.Scalars.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Types; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - } -} diff --git a/src/HotChocolate/Core/test/Types.Tests/ModuleInitializer.cs b/src/HotChocolate/Core/test/Types.Tests/ModuleInitializer.cs deleted file mode 100644 index 863a695b53e..00000000000 --- a/src/HotChocolate/Core/test/Types.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Core/test/Validation.Tests/ModuleInitializer.cs b/src/HotChocolate/Core/test/Validation.Tests/ModuleInitializer.cs deleted file mode 100644 index dc38ad350af..00000000000 --- a/src/HotChocolate/Core/test/Validation.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Validation; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - } -} diff --git a/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/ModuleInitializer.cs b/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/ModuleInitializer.cs deleted file mode 100644 index e030ee9a93b..00000000000 --- a/src/HotChocolate/CostAnalysis/test/CostAnalysis.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.CostAnalysis; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/CostAnalysis/test/Directory.Build.props b/src/HotChocolate/CostAnalysis/test/Directory.Build.props index 0129d035c93..33277d1d22c 100644 --- a/src/HotChocolate/CostAnalysis/test/Directory.Build.props +++ b/src/HotChocolate/CostAnalysis/test/Directory.Build.props @@ -16,6 +16,7 @@ + diff --git a/src/HotChocolate/Data/test/Data.AutoMapper.Tests/ModuleInitializer.cs b/src/HotChocolate/Data/test/Data.AutoMapper.Tests/ModuleInitializer.cs deleted file mode 100644 index e3982079f1c..00000000000 --- a/src/HotChocolate/Data/test/Data.AutoMapper.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Data.Projections; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - } -} diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/ModuleInitializer.cs b/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/ModuleInitializer.cs deleted file mode 100644 index b515a98631b..00000000000 --- a/src/HotChocolate/Data/test/Data.EntityFramework.Pagination.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Data; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Data/test/Data.EntityFramework.Tests/ModuleInitializer.cs b/src/HotChocolate/Data/test/Data.EntityFramework.Tests/ModuleInitializer.cs deleted file mode 100644 index b515a98631b..00000000000 --- a/src/HotChocolate/Data/test/Data.EntityFramework.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Data; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Data/test/Data.Filters.InMemory.Tests/ModuleInitializer.cs b/src/HotChocolate/Data/test/Data.Filters.InMemory.Tests/ModuleInitializer.cs deleted file mode 100644 index a56e4d6096e..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.InMemory.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Data.Filters; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/ModuleInitializer.cs b/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/ModuleInitializer.cs deleted file mode 100644 index a56e4d6096e..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Data.Filters; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/ModuleInitializer.cs b/src/HotChocolate/Data/test/Data.Filters.Tests/ModuleInitializer.cs deleted file mode 100644 index 36845924536..00000000000 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Data.Tests; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/ModuleInitializer.cs b/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/ModuleInitializer.cs deleted file mode 100644 index 5a1987592e9..00000000000 --- a/src/HotChocolate/Data/test/Data.Projections.SqlServer.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Data.Projections; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Data/test/Data.Projections.Tests/ModuleInitializer.cs b/src/HotChocolate/Data/test/Data.Projections.Tests/ModuleInitializer.cs deleted file mode 100644 index b515a98631b..00000000000 --- a/src/HotChocolate/Data/test/Data.Projections.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Data; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Data/test/Data.Sorting.InMemory.Tests/ModuleInitializer.cs b/src/HotChocolate/Data/test/Data.Sorting.InMemory.Tests/ModuleInitializer.cs deleted file mode 100644 index fd37f886628..00000000000 --- a/src/HotChocolate/Data/test/Data.Sorting.InMemory.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Data.Sorting; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Data/test/Data.Sorting.SqlLite.Tests/ModuleInitializer.cs b/src/HotChocolate/Data/test/Data.Sorting.SqlLite.Tests/ModuleInitializer.cs deleted file mode 100644 index fd37f886628..00000000000 --- a/src/HotChocolate/Data/test/Data.Sorting.SqlLite.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Data.Sorting; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Data/test/Data.Sorting.Tests/ModuleInitializer.cs b/src/HotChocolate/Data/test/Data.Sorting.Tests/ModuleInitializer.cs deleted file mode 100644 index 36845924536..00000000000 --- a/src/HotChocolate/Data/test/Data.Sorting.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Data.Tests; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Data/test/Data.Tests/ModuleInitializer.cs b/src/HotChocolate/Data/test/Data.Tests/ModuleInitializer.cs deleted file mode 100644 index b515a98631b..00000000000 --- a/src/HotChocolate/Data/test/Data.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Data; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Data/test/Directory.Build.props b/src/HotChocolate/Data/test/Directory.Build.props index 8db376fd335..4516f1b3c88 100644 --- a/src/HotChocolate/Data/test/Directory.Build.props +++ b/src/HotChocolate/Data/test/Directory.Build.props @@ -16,6 +16,7 @@ + diff --git a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/ModuleInitializer.cs b/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/ModuleInitializer.cs deleted file mode 100644 index fab883e7ab9..00000000000 --- a/src/HotChocolate/Diagnostics/test/Diagnostics.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Diagnostics; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - } -} diff --git a/src/HotChocolate/Diagnostics/test/Directory.Build.props b/src/HotChocolate/Diagnostics/test/Directory.Build.props index a3dc0e195f9..7ab10565328 100644 --- a/src/HotChocolate/Diagnostics/test/Directory.Build.props +++ b/src/HotChocolate/Diagnostics/test/Directory.Build.props @@ -14,6 +14,7 @@ + diff --git a/src/HotChocolate/Fusion-vnext/test/Directory.Build.props b/src/HotChocolate/Fusion-vnext/test/Directory.Build.props index c1e3152303f..bf3cc9cf8ff 100644 --- a/src/HotChocolate/Fusion-vnext/test/Directory.Build.props +++ b/src/HotChocolate/Fusion-vnext/test/Directory.Build.props @@ -21,6 +21,7 @@ + diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/Formatters/GraphQLSnapshotValueFormatter.cs b/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/Formatters/GraphQLSnapshotValueFormatter.cs index 18f7a3b5ad5..59ab4e53708 100644 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/Formatters/GraphQLSnapshotValueFormatter.cs +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/Formatters/GraphQLSnapshotValueFormatter.cs @@ -3,7 +3,7 @@ using HotChocolate.Language; using HotChocolate.Language.Utilities; -namespace CookieCrumble.HotChocolate.Formatters; +namespace HotChocolate.Fusion.Formatters; internal sealed class GraphQLSnapshotValueFormatter : SnapshotValueFormatter { diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/Formatters/ModuleInitializer.cs b/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/Formatters/ModuleInitializer.cs new file mode 100644 index 00000000000..1674fdee0fa --- /dev/null +++ b/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/Formatters/ModuleInitializer.cs @@ -0,0 +1,13 @@ +using CookieCrumble.Formatters; +using HotChocolate.Fusion.Formatters; + +// ReSharper disable once CheckNamespace +namespace HotChocolate.Fusion; + +internal static partial class ModuleInitializer +{ + static partial void OnInitialize(Action register) + { + register(new GraphQLSnapshotValueFormatter()); + } +} diff --git a/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/ModuleInitializer.cs b/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/ModuleInitializer.cs deleted file mode 100644 index 79e24cfcaf3..00000000000 --- a/src/HotChocolate/Fusion-vnext/test/Fusion.Execution.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Runtime.CompilerServices; -using CookieCrumble.HotChocolate.Formatters; - -namespace HotChocolate.Fusion; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit3.Initialize(); - Snapshot.RegisterFormatter(new GraphQLSnapshotValueFormatter()); - } -} diff --git a/src/HotChocolate/Fusion/test/CommandLine.Tests/ModuleInitializer.cs b/src/HotChocolate/Fusion/test/CommandLine.Tests/ModuleInitializer.cs deleted file mode 100644 index 99df64613ca..00000000000 --- a/src/HotChocolate/Fusion/test/CommandLine.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace CommandLine.Tests; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Fusion/test/Composition.Tests/ModuleInitializer.cs b/src/HotChocolate/Fusion/test/Composition.Tests/ModuleInitializer.cs deleted file mode 100644 index 6919f4cc6c0..00000000000 --- a/src/HotChocolate/Fusion/test/Composition.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Fusion.Composition; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Fusion/test/Core.Tests/ModuleInitializer.cs b/src/HotChocolate/Fusion/test/Core.Tests/ModuleInitializer.cs deleted file mode 100644 index 4b0e1ed2d10..00000000000 --- a/src/HotChocolate/Fusion/test/Core.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Fusion; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleFusion.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Fusion/test/Directory.Build.props b/src/HotChocolate/Fusion/test/Directory.Build.props index 1aa50dc6669..e71e3ce23e8 100644 --- a/src/HotChocolate/Fusion/test/Directory.Build.props +++ b/src/HotChocolate/Fusion/test/Directory.Build.props @@ -19,6 +19,7 @@ + diff --git a/src/HotChocolate/Language/test/Directory.Build.props b/src/HotChocolate/Language/test/Directory.Build.props index b318963e4da..e0781dca5f8 100644 --- a/src/HotChocolate/Language/test/Directory.Build.props +++ b/src/HotChocolate/Language/test/Directory.Build.props @@ -15,6 +15,7 @@ + diff --git a/src/HotChocolate/Language/test/Language.SyntaxTree.Tests/ModuleInitializer.cs b/src/HotChocolate/Language/test/Language.SyntaxTree.Tests/ModuleInitializer.cs deleted file mode 100644 index b1b9d5fe2d1..00000000000 --- a/src/HotChocolate/Language/test/Language.SyntaxTree.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Language.SyntaxTree; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - } -} diff --git a/src/HotChocolate/Language/test/Language.Tests/ModuleInitializer.cs b/src/HotChocolate/Language/test/Language.Tests/ModuleInitializer.cs deleted file mode 100644 index 9057b0468be..00000000000 --- a/src/HotChocolate/Language/test/Language.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Language; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Language/test/Language.Web.Tests/ModuleInitializer.cs b/src/HotChocolate/Language/test/Language.Web.Tests/ModuleInitializer.cs deleted file mode 100644 index cf95dfd1c90..00000000000 --- a/src/HotChocolate/Language/test/Language.Web.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Language; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - } -} diff --git a/src/HotChocolate/Marten/test/Data.Marten.Filters.Tests/ModuleInitializer.cs b/src/HotChocolate/Marten/test/Data.Marten.Filters.Tests/ModuleInitializer.cs deleted file mode 100644 index b515a98631b..00000000000 --- a/src/HotChocolate/Marten/test/Data.Marten.Filters.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Data; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Marten/test/Data.Marten.Sorting.Tests/ModuleInitializer.cs b/src/HotChocolate/Marten/test/Data.Marten.Sorting.Tests/ModuleInitializer.cs deleted file mode 100644 index b515a98631b..00000000000 --- a/src/HotChocolate/Marten/test/Data.Marten.Sorting.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Data; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Marten/test/Directory.Build.props b/src/HotChocolate/Marten/test/Directory.Build.props index 7baf4c5ea66..7b5e79f43f8 100644 --- a/src/HotChocolate/Marten/test/Directory.Build.props +++ b/src/HotChocolate/Marten/test/Directory.Build.props @@ -16,6 +16,7 @@ + diff --git a/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/ModuleInitializer.cs b/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/ModuleInitializer.cs deleted file mode 100644 index fc76dd7bdd8..00000000000 --- a/src/HotChocolate/MongoDb/test/Data.MongoDb.Filters.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Data.MongoDb.Filters; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/MongoDb/test/Data.MongoDb.Paging.Tests/ModuleInitializer.cs b/src/HotChocolate/MongoDb/test/Data.MongoDb.Paging.Tests/ModuleInitializer.cs deleted file mode 100644 index ddb915ce361..00000000000 --- a/src/HotChocolate/MongoDb/test/Data.MongoDb.Paging.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Data.MongoDb.Paging; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - } -} diff --git a/src/HotChocolate/MongoDb/test/Data.MongoDb.Projections.Tests/ModuleInitializer.cs b/src/HotChocolate/MongoDb/test/Data.MongoDb.Projections.Tests/ModuleInitializer.cs deleted file mode 100644 index 7ef38d94997..00000000000 --- a/src/HotChocolate/MongoDb/test/Data.MongoDb.Projections.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Data.MongoDb.Projections; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - } -} diff --git a/src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/ModuleInitializer.cs b/src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/ModuleInitializer.cs deleted file mode 100644 index 1f0d5b7b924..00000000000 --- a/src/HotChocolate/MongoDb/test/Data.MongoDb.Sorting.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Data.MongoDb.Sorting; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - } -} diff --git a/src/HotChocolate/MongoDb/test/Directory.Build.props b/src/HotChocolate/MongoDb/test/Directory.Build.props index 7baf4c5ea66..7b5e79f43f8 100644 --- a/src/HotChocolate/MongoDb/test/Directory.Build.props +++ b/src/HotChocolate/MongoDb/test/Directory.Build.props @@ -16,6 +16,7 @@ + diff --git a/src/HotChocolate/MongoDb/test/Types.MongoDb/ModuleInitializer.cs b/src/HotChocolate/MongoDb/test/Types.MongoDb/ModuleInitializer.cs deleted file mode 100644 index ecc2344c08f..00000000000 --- a/src/HotChocolate/MongoDb/test/Types.MongoDb/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Types; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/OpenApi/test/Directory.Build.props b/src/HotChocolate/OpenApi/test/Directory.Build.props index 428761ef50c..5b3630fd7db 100644 --- a/src/HotChocolate/OpenApi/test/Directory.Build.props +++ b/src/HotChocolate/OpenApi/test/Directory.Build.props @@ -16,6 +16,7 @@ + diff --git a/src/HotChocolate/OpenApi/test/HotChocolate.OpenApi.Tests/ModuleInitializer.cs b/src/HotChocolate/OpenApi/test/HotChocolate.OpenApi.Tests/ModuleInitializer.cs deleted file mode 100644 index d72ac9c8d36..00000000000 --- a/src/HotChocolate/OpenApi/test/HotChocolate.OpenApi.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.OpenApi.Tests; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Pagination/test/Directory.Build.props b/src/HotChocolate/Pagination/test/Directory.Build.props index 8db376fd335..4516f1b3c88 100644 --- a/src/HotChocolate/Pagination/test/Directory.Build.props +++ b/src/HotChocolate/Pagination/test/Directory.Build.props @@ -16,6 +16,7 @@ + diff --git a/src/HotChocolate/Pagination/test/Pagination.EntityFramework.Tests/ModuleInitializer.cs b/src/HotChocolate/Pagination/test/Pagination.EntityFramework.Tests/ModuleInitializer.cs deleted file mode 100644 index b515a98631b..00000000000 --- a/src/HotChocolate/Pagination/test/Pagination.EntityFramework.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Data; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/PersistedOperations/test/Directory.Build.props b/src/HotChocolate/PersistedOperations/test/Directory.Build.props index 7baf4c5ea66..7b5e79f43f8 100644 --- a/src/HotChocolate/PersistedOperations/test/Directory.Build.props +++ b/src/HotChocolate/PersistedOperations/test/Directory.Build.props @@ -16,6 +16,7 @@ + diff --git a/src/HotChocolate/PersistedOperations/test/PersistedOperations.AzureBlobStorage.Tests/ModuleInitializer.cs b/src/HotChocolate/PersistedOperations/test/PersistedOperations.AzureBlobStorage.Tests/ModuleInitializer.cs deleted file mode 100644 index 16c799aa06d..00000000000 --- a/src/HotChocolate/PersistedOperations/test/PersistedOperations.AzureBlobStorage.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.PersistedOperations.AzureBlobStorage; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/PersistedOperations/test/PersistedOperations.FileSystem.Tests/ModuleInitializer.cs b/src/HotChocolate/PersistedOperations/test/PersistedOperations.FileSystem.Tests/ModuleInitializer.cs deleted file mode 100644 index a576b134a29..00000000000 --- a/src/HotChocolate/PersistedOperations/test/PersistedOperations.FileSystem.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.PersistedOperations.FileSystem; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/PersistedOperations/test/PersistedOperations.InMemory.Tests/ModuleInitializer.cs b/src/HotChocolate/PersistedOperations/test/PersistedOperations.InMemory.Tests/ModuleInitializer.cs deleted file mode 100644 index bf527e671e6..00000000000 --- a/src/HotChocolate/PersistedOperations/test/PersistedOperations.InMemory.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.PersistedOperations.InMemory; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - } -} diff --git a/src/HotChocolate/PersistedOperations/test/PersistedOperations.Redis.Tests/ModuleInitializer.cs b/src/HotChocolate/PersistedOperations/test/PersistedOperations.Redis.Tests/ModuleInitializer.cs deleted file mode 100644 index 640098fe9e8..00000000000 --- a/src/HotChocolate/PersistedOperations/test/PersistedOperations.Redis.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.PersistedOperations.Redis; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Raven/test/Data.Raven.Filters.Tests/ModuleInitializer.cs b/src/HotChocolate/Raven/test/Data.Raven.Filters.Tests/ModuleInitializer.cs deleted file mode 100644 index a56e4d6096e..00000000000 --- a/src/HotChocolate/Raven/test/Data.Raven.Filters.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Data.Filters; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Raven/test/Data.Raven.Paging.Tests/ModuleInitializer.cs b/src/HotChocolate/Raven/test/Data.Raven.Paging.Tests/ModuleInitializer.cs deleted file mode 100644 index a3b5a9cffce..00000000000 --- a/src/HotChocolate/Raven/test/Data.Raven.Paging.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Data; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - } -} diff --git a/src/HotChocolate/Raven/test/Data.Raven.Projections.Tests/ModuleInitializer.cs b/src/HotChocolate/Raven/test/Data.Raven.Projections.Tests/ModuleInitializer.cs deleted file mode 100644 index 6a70e1031fd..00000000000 --- a/src/HotChocolate/Raven/test/Data.Raven.Projections.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Data.Raven; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - } -} diff --git a/src/HotChocolate/Raven/test/Data.Raven.Sorting.Tests/ModuleInitializer.cs b/src/HotChocolate/Raven/test/Data.Raven.Sorting.Tests/ModuleInitializer.cs deleted file mode 100644 index fd37f886628..00000000000 --- a/src/HotChocolate/Raven/test/Data.Raven.Sorting.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Data.Sorting; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Raven/test/Data.Raven.Tests/ModuleInitializer.cs b/src/HotChocolate/Raven/test/Data.Raven.Tests/ModuleInitializer.cs deleted file mode 100644 index 22c6ad2e6b5..00000000000 --- a/src/HotChocolate/Raven/test/Data.Raven.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Data.Raven.Test; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Raven/test/Directory.Build.props b/src/HotChocolate/Raven/test/Directory.Build.props index 7baf4c5ea66..7b5e79f43f8 100644 --- a/src/HotChocolate/Raven/test/Directory.Build.props +++ b/src/HotChocolate/Raven/test/Directory.Build.props @@ -16,6 +16,7 @@ + diff --git a/src/HotChocolate/Skimmed/test/Directory.Build.props b/src/HotChocolate/Skimmed/test/Directory.Build.props index 5ee232e004d..c634a241398 100644 --- a/src/HotChocolate/Skimmed/test/Directory.Build.props +++ b/src/HotChocolate/Skimmed/test/Directory.Build.props @@ -14,6 +14,7 @@ + diff --git a/src/HotChocolate/Skimmed/test/Skimmed.Tests/ModuleInitializer.cs b/src/HotChocolate/Skimmed/test/Skimmed.Tests/ModuleInitializer.cs deleted file mode 100644 index ae99d219542..00000000000 --- a/src/HotChocolate/Skimmed/test/Skimmed.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Skimmed; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - } -} diff --git a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/ModuleInitializer.cs b/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/ModuleInitializer.cs deleted file mode 100644 index aabeeb77b04..00000000000 --- a/src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Data.Spatial.Filters; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - } -} diff --git a/src/HotChocolate/Spatial/test/Data.Projections.SqlServer.Tests/ModuleInitializer.cs b/src/HotChocolate/Spatial/test/Data.Projections.SqlServer.Tests/ModuleInitializer.cs deleted file mode 100644 index b9d960a50e3..00000000000 --- a/src/HotChocolate/Spatial/test/Data.Projections.SqlServer.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Data.Projections.Spatial; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - } -} diff --git a/src/HotChocolate/Spatial/test/Data.Tests/ModuleInitializer.cs b/src/HotChocolate/Spatial/test/Data.Tests/ModuleInitializer.cs deleted file mode 100644 index 474e535cc39..00000000000 --- a/src/HotChocolate/Spatial/test/Data.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Data.Spatial; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - } -} diff --git a/src/HotChocolate/Spatial/test/Directory.Build.props b/src/HotChocolate/Spatial/test/Directory.Build.props index 7baf4c5ea66..7b5e79f43f8 100644 --- a/src/HotChocolate/Spatial/test/Directory.Build.props +++ b/src/HotChocolate/Spatial/test/Directory.Build.props @@ -16,6 +16,7 @@ + diff --git a/src/HotChocolate/Spatial/test/Types.Tests/ModuleInitializer.cs b/src/HotChocolate/Spatial/test/Types.Tests/ModuleInitializer.cs deleted file mode 100644 index 9f1bf32191b..00000000000 --- a/src/HotChocolate/Spatial/test/Types.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Types.Spatial; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - CookieCrumbleHotChocolate.Initialize(); - } -} diff --git a/src/HotChocolate/Utilities/test/Directory.Build.props b/src/HotChocolate/Utilities/test/Directory.Build.props index 04c5004ba5b..fb8284853ba 100644 --- a/src/HotChocolate/Utilities/test/Directory.Build.props +++ b/src/HotChocolate/Utilities/test/Directory.Build.props @@ -13,6 +13,7 @@ + diff --git a/src/HotChocolate/Utilities/test/Utilities.Introspection.Tests/ModuleInitializer.cs b/src/HotChocolate/Utilities/test/Utilities.Introspection.Tests/ModuleInitializer.cs deleted file mode 100644 index ccae5470d74..00000000000 --- a/src/HotChocolate/Utilities/test/Utilities.Introspection.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace HotChocolate.Utilities.Introspection; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - } -} diff --git a/src/StrawberryShake/Client/test/Core.Tests/ModuleInitializer.cs b/src/StrawberryShake/Client/test/Core.Tests/ModuleInitializer.cs deleted file mode 100644 index e0b9735f658..00000000000 --- a/src/StrawberryShake/Client/test/Core.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace StrawberryShake; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - } -} diff --git a/src/StrawberryShake/Client/test/Core.Tests/OperationResultBuilderTests.cs b/src/StrawberryShake/Client/test/Core.Tests/OperationResultBuilderTests.cs index d8aa70ec737..faa95ce8657 100644 --- a/src/StrawberryShake/Client/test/Core.Tests/OperationResultBuilderTests.cs +++ b/src/StrawberryShake/Client/test/Core.Tests/OperationResultBuilderTests.cs @@ -1,3 +1,4 @@ +using System.Runtime.CompilerServices; using System.Text.Json; namespace StrawberryShake; diff --git a/src/StrawberryShake/Client/test/Directory.Build.props b/src/StrawberryShake/Client/test/Directory.Build.props index 83ea79441d6..ceb72ee5c84 100644 --- a/src/StrawberryShake/Client/test/Directory.Build.props +++ b/src/StrawberryShake/Client/test/Directory.Build.props @@ -14,6 +14,7 @@ + diff --git a/src/StrawberryShake/Client/test/Transport.Http.Tests/ModuleInitializer.cs b/src/StrawberryShake/Client/test/Transport.Http.Tests/ModuleInitializer.cs deleted file mode 100644 index 934c28cba32..00000000000 --- a/src/StrawberryShake/Client/test/Transport.Http.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace StrawberryShake.Transport.Http; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - } -} diff --git a/src/StrawberryShake/Client/test/Transport.InMemory.Tests/ModuleInitializer.cs b/src/StrawberryShake/Client/test/Transport.InMemory.Tests/ModuleInitializer.cs deleted file mode 100644 index 5391f8798e9..00000000000 --- a/src/StrawberryShake/Client/test/Transport.InMemory.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace StrawberryShake.Transport.InMemory; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - } -} diff --git a/src/StrawberryShake/Client/test/Transport.WebSocket.Tests/ModuleInitializer.cs b/src/StrawberryShake/Client/test/Transport.WebSocket.Tests/ModuleInitializer.cs deleted file mode 100644 index cda35c206ca..00000000000 --- a/src/StrawberryShake/Client/test/Transport.WebSocket.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace StrawberryShake.Transport.WebSockets; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - } -} diff --git a/src/StrawberryShake/Tooling/test/Configuration.Tests/FileContentsTests.cs b/src/StrawberryShake/Tooling/test/Configuration.Tests/FileContentsTests.cs index da3452df48e..cb10b0ed6f0 100644 --- a/src/StrawberryShake/Tooling/test/Configuration.Tests/FileContentsTests.cs +++ b/src/StrawberryShake/Tooling/test/Configuration.Tests/FileContentsTests.cs @@ -1,3 +1,4 @@ +using System.Runtime.CompilerServices; using Xunit; namespace StrawberryShake.Tools.Configuration; diff --git a/src/StrawberryShake/Tooling/test/Configuration.Tests/ModuleInitializer.cs b/src/StrawberryShake/Tooling/test/Configuration.Tests/ModuleInitializer.cs deleted file mode 100644 index c89c9be0fb1..00000000000 --- a/src/StrawberryShake/Tooling/test/Configuration.Tests/ModuleInitializer.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Runtime.CompilerServices; - -namespace StrawberryShake.Tools.Configuration; - -internal static class ModuleInitializer -{ - [ModuleInitializer] - public static void Initialize() - { - CookieCrumbleXunit.Initialize(); - } -} diff --git a/src/StrawberryShake/Tooling/test/Directory.Build.props b/src/StrawberryShake/Tooling/test/Directory.Build.props index a4d2e4638f1..0ed66b15a11 100644 --- a/src/StrawberryShake/Tooling/test/Directory.Build.props +++ b/src/StrawberryShake/Tooling/test/Directory.Build.props @@ -13,6 +13,7 @@ +