From f6615dc0e9db49a4962769886c2d85f81ac3be21 Mon Sep 17 00:00:00 2001 From: Daniel Weber Date: Wed, 26 Feb 2025 09:16:08 +0100 Subject: [PATCH] All the test classes can do without inheriting VerifyBase. --- .../GremlinqConfigurationSectionTests.cs | 4 ++-- .../ProviderConfigurationSectionTests.cs | 4 ++-- test/Core.Tests/BytecodeExtensionsTest.cs | 11 ++--------- test/Core.Tests/FastImmutableListTest.cs | 6 +----- test/Core.Tests/GraphModelTest.cs | 7 +------ test/Core.Tests/GremlinQueryExecutorTest.cs | 4 ++-- test/Core.Tests/GremlinQueryTest.cs | 4 ++-- test/Core.Tests/ProjectionTest.cs | 4 ++-- test/Core.Tests/TansformerTest.cs | 7 +------ test/Core.Tests/TraversalTest.cs | 8 +++----- test/Core.Tests/TypeSystemTest.cs | 7 +------ test/Providers.Core.Tests/PoolTests.cs | 7 +------ test/PublicApi.Tests/PublicApiTests.cs | 9 ++------- test/Support.NewtonsoftJson.Tests/Issues/Issue219.cs | 7 +------ test/Support.NewtonsoftJson.Tests/TransformerTest.cs | 4 ++-- .../GraphSon/GraphsonSupportTestBase.cs | 11 +++++++---- test/Tests.Infrastructure/QueryExecutionTest.cs | 1 - 17 files changed, 32 insertions(+), 73 deletions(-) diff --git a/test/Core.AspNet.Tests/GremlinqConfigurationSectionTests.cs b/test/Core.AspNet.Tests/GremlinqConfigurationSectionTests.cs index ba1a202335..bd60429188 100644 --- a/test/Core.AspNet.Tests/GremlinqConfigurationSectionTests.cs +++ b/test/Core.AspNet.Tests/GremlinqConfigurationSectionTests.cs @@ -3,11 +3,11 @@ namespace ExRam.Gremlinq.Core.AspNet.Tests { - public class GremlinqConfigurationSectionTests : VerifyBase + public class GremlinqConfigurationSectionTests { private readonly IGremlinqConfigurationSection _section; - public GremlinqConfigurationSectionTests() : base() + public GremlinqConfigurationSectionTests() { var serviceCollection = new ServiceCollection() .AddSingleton(new ConfigurationBuilder() diff --git a/test/Core.AspNet.Tests/ProviderConfigurationSectionTests.cs b/test/Core.AspNet.Tests/ProviderConfigurationSectionTests.cs index 69d650a0ee..ac36f1fc21 100644 --- a/test/Core.AspNet.Tests/ProviderConfigurationSectionTests.cs +++ b/test/Core.AspNet.Tests/ProviderConfigurationSectionTests.cs @@ -3,7 +3,7 @@ namespace ExRam.Gremlinq.Core.AspNet.Tests { - public class ProviderConfigurationSectionTests : VerifyBase + public class ProviderConfigurationSectionTests { private readonly IConfigurationRoot _configurationRoot; @@ -12,7 +12,7 @@ private interface IMyProviderConfigurator : IGremlinqConfigurator diff --git a/test/Core.Tests/BytecodeExtensionsTest.cs b/test/Core.Tests/BytecodeExtensionsTest.cs index 5f6fa63b25..c5b893e2d2 100644 --- a/test/Core.Tests/BytecodeExtensionsTest.cs +++ b/test/Core.Tests/BytecodeExtensionsTest.cs @@ -1,17 +1,10 @@ -using System.Collections.Immutable; - -using ExRam.Gremlinq.Core.Serialization; +using ExRam.Gremlinq.Core.Serialization; using Gremlin.Net.Process.Traversal; namespace ExRam.Gremlinq.Core.Tests { - public class BytecodeExtensionsTest : VerifyBase + public class BytecodeExtensionsTest { - public BytecodeExtensionsTest() : base() - { - - } - [Fact] public Task GroovyExpression_is_handled_correctly() { diff --git a/test/Core.Tests/FastImmutableListTest.cs b/test/Core.Tests/FastImmutableListTest.cs index e8b4c87594..6b81ce3e32 100644 --- a/test/Core.Tests/FastImmutableListTest.cs +++ b/test/Core.Tests/FastImmutableListTest.cs @@ -2,12 +2,8 @@ namespace ExRam.Gremlinq.Core.Tests { - public class FastImmutableListTest : VerifyBase + public class FastImmutableListTest { - public FastImmutableListTest() : base() - { - } - [Fact] public void Concurrency() { diff --git a/test/Core.Tests/GraphModelTest.cs b/test/Core.Tests/GraphModelTest.cs index f9e06ab7bc..0ea1fe1976 100644 --- a/test/Core.Tests/GraphModelTest.cs +++ b/test/Core.Tests/GraphModelTest.cs @@ -6,13 +6,8 @@ namespace ExRam.Gremlinq.Core.Tests { - public class GraphModelTest : VerifyBase + public class GraphModelTest { - public GraphModelTest() : base() - { - - } - [Fact] public void Fody_works() { diff --git a/test/Core.Tests/GremlinQueryExecutorTest.cs b/test/Core.Tests/GremlinQueryExecutorTest.cs index 9c71294748..7533bfe515 100644 --- a/test/Core.Tests/GremlinQueryExecutorTest.cs +++ b/test/Core.Tests/GremlinQueryExecutorTest.cs @@ -9,11 +9,11 @@ namespace ExRam.Gremlinq.Core.Tests { - public class GremlinQueryExecutorTest : VerifyBase + public class GremlinQueryExecutorTest { private readonly IVertexGremlinQuery _query; - public GremlinQueryExecutorTest() : base() + public GremlinQueryExecutorTest() { _query = GremlinQuerySource.g.V(); } diff --git a/test/Core.Tests/GremlinQueryTest.cs b/test/Core.Tests/GremlinQueryTest.cs index 3f173dc06e..c3d2f56589 100644 --- a/test/Core.Tests/GremlinQueryTest.cs +++ b/test/Core.Tests/GremlinQueryTest.cs @@ -8,11 +8,11 @@ namespace ExRam.Gremlinq.Core.Tests { - public class GremlinQueryTest : VerifyBase + public class GremlinQueryTest { private readonly IGremlinQuerySource _g; - public GremlinQueryTest() : base() + public GremlinQueryTest() { _g = g .ConfigureEnvironment(_ => _ diff --git a/test/Core.Tests/ProjectionTest.cs b/test/Core.Tests/ProjectionTest.cs index f4a78fabb0..5f07354f64 100644 --- a/test/Core.Tests/ProjectionTest.cs +++ b/test/Core.Tests/ProjectionTest.cs @@ -4,11 +4,11 @@ namespace ExRam.Gremlinq.Core.Tests { - public class ProjectionTest : VerifyBase + public class ProjectionTest { private readonly IGremlinQuerySource _g; - public ProjectionTest() : base() + public ProjectionTest() { _g = g .ConfigureEnvironment(x => x.UseModel(GraphModel diff --git a/test/Core.Tests/TansformerTest.cs b/test/Core.Tests/TansformerTest.cs index 411e643ba7..69d54b8d55 100644 --- a/test/Core.Tests/TansformerTest.cs +++ b/test/Core.Tests/TansformerTest.cs @@ -4,13 +4,8 @@ namespace ExRam.Gremlinq.Core.Tests { - public class TansformerTest : VerifyBase + public class TansformerTest { - public TansformerTest() : base() - { - - } - [Fact] public async Task Empty() { diff --git a/test/Core.Tests/TraversalTest.cs b/test/Core.Tests/TraversalTest.cs index e8a10ed7da..eb8e26b673 100644 --- a/test/Core.Tests/TraversalTest.cs +++ b/test/Core.Tests/TraversalTest.cs @@ -1,11 +1,9 @@ -using System.Collections.Immutable; - -using ExRam.Gremlinq.Core.Steps; +using ExRam.Gremlinq.Core.Steps; using FluentAssertions; namespace ExRam.Gremlinq.Core.Tests { - public class TraversalTest : VerifyBase + public class TraversalTest { private readonly Traversal _traversal; private readonly IdentityStep _step1 = new (); @@ -15,7 +13,7 @@ public class TraversalTest : VerifyBase private readonly IdentityStep _step5 = new (); private readonly IdentityStep _step6 = new (); - public TraversalTest() : base() + public TraversalTest() { _traversal = Traversal.Empty .Push(_step1) diff --git a/test/Core.Tests/TypeSystemTest.cs b/test/Core.Tests/TypeSystemTest.cs index 0f49e4769a..b6bf782627 100644 --- a/test/Core.Tests/TypeSystemTest.cs +++ b/test/Core.Tests/TypeSystemTest.cs @@ -7,7 +7,7 @@ namespace ExRam.Gremlinq.Core.Tests { - public class TypeSystemTest : VerifyBase + public class TypeSystemTest { private sealed class Vertex { @@ -38,11 +38,6 @@ private sealed class Edge .ConfigureEnvironment(_ => _ .UseModel(GraphModel.FromBaseTypes())); - public TypeSystemTest() : base() - { - - } - [Fact] public void V_Properties_String() { diff --git a/test/Providers.Core.Tests/PoolTests.cs b/test/Providers.Core.Tests/PoolTests.cs index e9b06825ca..c22412c0f6 100644 --- a/test/Providers.Core.Tests/PoolTests.cs +++ b/test/Providers.Core.Tests/PoolTests.cs @@ -10,13 +10,8 @@ namespace ExRam.Gremlinq.Providers.Core.Tests { - public class PoolTests : VerifyBase + public class PoolTests { - public PoolTests() : base() - { - - } - [Fact] public async Task Pool_creates_subClient() { diff --git a/test/PublicApi.Tests/PublicApiTests.cs b/test/PublicApi.Tests/PublicApiTests.cs index c009228d2f..a99ba9edfe 100644 --- a/test/PublicApi.Tests/PublicApiTests.cs +++ b/test/PublicApi.Tests/PublicApiTests.cs @@ -3,13 +3,8 @@ namespace ExRam.Gremlinq.PublicApi.Tests { - public class PublicApiTests : VerifyBase + public class PublicApiTests { - public PublicApiTests() : base() - { - - } - [Fact] public Task Core() => Verify("ExRam.Gremlinq.Core"); @@ -46,7 +41,7 @@ public PublicApiTests() : base() [Fact] public Task SupportNewtonsoftJson() => Verify("ExRam.Gremlinq.Support.NewtonsoftJson"); - private Task Verify(string assemblyName) => base + private Task Verify(string assemblyName) => Verifier .Verify( Assembly .Load(assemblyName) diff --git a/test/Support.NewtonsoftJson.Tests/Issues/Issue219.cs b/test/Support.NewtonsoftJson.Tests/Issues/Issue219.cs index 0b6d2b023f..1b278164dc 100644 --- a/test/Support.NewtonsoftJson.Tests/Issues/Issue219.cs +++ b/test/Support.NewtonsoftJson.Tests/Issues/Issue219.cs @@ -8,7 +8,7 @@ namespace ExRam.Gremlinq.Support.NewtonsoftJson.Tests { - public sealed class Issue219 : VerifyBase + public sealed class Issue219 { private readonly struct CustomMemoryOwner : IMemoryOwner { @@ -33,11 +33,6 @@ public void Dispose() } } - public Issue219() : base() - { - - } - [Fact] public Task Repro() { diff --git a/test/Support.NewtonsoftJson.Tests/TransformerTest.cs b/test/Support.NewtonsoftJson.Tests/TransformerTest.cs index 2191fd0f39..9984640b07 100644 --- a/test/Support.NewtonsoftJson.Tests/TransformerTest.cs +++ b/test/Support.NewtonsoftJson.Tests/TransformerTest.cs @@ -11,11 +11,11 @@ namespace ExRam.Gremlinq.Support.NewtonsoftJson.Tests { - public class TransformerTest : VerifyBase + public class TransformerTest { private readonly IGremlinQueryEnvironment _environment; - public TransformerTest() : base() + public TransformerTest() { _environment = GremlinQueryEnvironment.Invalid .UseModel(GraphModel.FromBaseTypes()) diff --git a/test/Tests.Infrastructure/GraphSon/GraphsonSupportTestBase.cs b/test/Tests.Infrastructure/GraphSon/GraphsonSupportTestBase.cs index d3a1e98ab0..4d2154aa74 100644 --- a/test/Tests.Infrastructure/GraphSon/GraphsonSupportTestBase.cs +++ b/test/Tests.Infrastructure/GraphSon/GraphsonSupportTestBase.cs @@ -13,12 +13,15 @@ namespace ExRam.Gremlinq.Tests.Infrastructure { - public abstract class GraphsonSupportTestBase : VerifyBase + public abstract class GraphsonSupportTestBase { + private readonly string _sourceFile; protected readonly IGremlinQueryEnvironment _environment; - protected GraphsonSupportTestBase(Func environmentTransformation, [CallerFilePath] string sourceFile = "") : base(sourceFile: sourceFile) + protected GraphsonSupportTestBase(Func environmentTransformation, [CallerFilePath] string sourceFile = "") { + _sourceFile = sourceFile; + _environment = GremlinQuerySource.g .ConfigureEnvironment(env => environmentTransformation .Invoke(env @@ -38,8 +41,8 @@ protected virtual Task Verify(string token, Func() .From(CreateNativeToken(token), environment); - return this - .Verify(subject) + return Verifier + .Verify(subject, sourceFile: _sourceFile) .DontScrubDateTimes(); } diff --git a/test/Tests.Infrastructure/QueryExecutionTest.cs b/test/Tests.Infrastructure/QueryExecutionTest.cs index 530bc5834d..15ae29389f 100644 --- a/test/Tests.Infrastructure/QueryExecutionTest.cs +++ b/test/Tests.Infrastructure/QueryExecutionTest.cs @@ -7,7 +7,6 @@ using static ExRam.Gremlinq.Core.Transformation.ConverterFactory; using ExRam.Gremlinq.Core; using FluentAssertions; -using Gremlin.Net.Process.Traversal; namespace ExRam.Gremlinq.Tests.Infrastructure {