diff --git a/src/GalaxyCheck.Xunit.Tests/GalaxyCheck.Xunit.Tests.csproj b/src/GalaxyCheck.Xunit.Tests/GalaxyCheck.Xunit.Tests.csproj
index c8547a69..a9dc625c 100644
--- a/src/GalaxyCheck.Xunit.Tests/GalaxyCheck.Xunit.Tests.csproj
+++ b/src/GalaxyCheck.Xunit.Tests/GalaxyCheck.Xunit.Tests.csproj
@@ -2,16 +2,16 @@
net6.0
- 9.0
+ 10.0
false
Tests
enable
-
-
-
+
+
+
diff --git a/src/GalaxyCheck.Xunit.Tests/GenSnapshotInitializerTests/AboutAssertSnapshotMatches.cs b/src/GalaxyCheck.Xunit.Tests/GenSnapshotInitializerTests/AboutAssertSnapshotMatches.cs
new file mode 100644
index 00000000..bd7d3b7c
--- /dev/null
+++ b/src/GalaxyCheck.Xunit.Tests/GenSnapshotInitializerTests/AboutAssertSnapshotMatches.cs
@@ -0,0 +1,47 @@
+using FluentAssertions;
+using GalaxyCheck;
+using GalaxyCheck.Configuration;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Xunit;
+
+namespace Tests.GenSnapshotInitializerTests
+{
+ public class AboutAssertSnapshotMatches
+ {
+#pragma warning disable xUnit1000 // Test classes must be public
+ private class GenSnapshots
+#pragma warning restore xUnit1000 // Test classes must be public
+ {
+ [GenSnapshot]
+ public object GenSnapshot() => new { };
+ }
+
+ [Fact]
+ public void ItPassesThroughAssertSnapshotMatches()
+ {
+ Func assertSnapshotMatches = (_) => Task.CompletedTask;
+
+ var result = TestProxy.Initialize(
+ typeof(GenSnapshots),
+ nameof(GenSnapshots.GenSnapshot),
+ configure: config => config.AssertSnapshotMatches = assertSnapshotMatches);
+
+ result.AssertSnapshotMatches.Should().Be(assertSnapshotMatches);
+ }
+
+ [Fact]
+ public void ItThrowsIfAssertSnapshotMatchesIsNull()
+ {
+ var action = () => TestProxy.Initialize(
+ typeof(GenSnapshots),
+ nameof(GenSnapshots.GenSnapshot),
+ configure: config => config.AssertSnapshotMatches = null);
+
+ action.Should().Throw().WithMessage("Configuration value \"AssertSnapshotMatches\" needs to be set in order to use gen snapshots");
+ }
+ }
+}
diff --git a/src/GalaxyCheck.Xunit.Tests/GenSnapshotInitializerTests/AboutFactory.cs b/src/GalaxyCheck.Xunit.Tests/GenSnapshotInitializerTests/AboutFactory.cs
new file mode 100644
index 00000000..58a6358d
--- /dev/null
+++ b/src/GalaxyCheck.Xunit.Tests/GenSnapshotInitializerTests/AboutFactory.cs
@@ -0,0 +1,201 @@
+using GalaxyCheck;
+using GalaxyCheck.Gens;
+using GalaxyCheck.Internal;
+using Moq;
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using Xunit;
+
+namespace Tests.GenSnapshotInitializerTests
+{
+ public class AboutFactory
+ {
+ [Theory]
+ [InlineData(nameof(GenSnapshotsWithoutFactoryConfig.GenSnapshotWithoutFactoryConfig))]
+ public void WhenClassNorMethodHasFactoryConfig_ItPassesThroughNull(string testMethodName)
+ {
+ var mockParametersGenFactory = MockParametersGenFactory();
+
+ TestProxy.Initialize(
+ typeof(GenSnapshotsWithoutFactoryConfig),
+ testMethodName,
+ parametersGenFactory: mockParametersGenFactory.Object);
+
+ VerifyFactoryNotPassedThrough(mockParametersGenFactory);
+ }
+
+ [Theory]
+ [InlineData(nameof(GenSnapshotsWithoutFactoryConfig.GenSnapshotWithFactoryConfig))]
+ public void ItPassesThroughTheFactoryFromTheMethod(string testMethodName)
+ {
+ var mockParametersGenFactory = MockParametersGenFactory();
+
+ TestProxy.Initialize(
+ typeof(GenSnapshotsWithoutFactoryConfig),
+ testMethodName,
+ parametersGenFactory: mockParametersGenFactory.Object);
+
+ VerifyFactoryPassedThrough(mockParametersGenFactory, typeof(GenFactory1));
+ }
+
+ [Theory]
+ [InlineData(nameof(GenSnapshotsWithFactoryConfig.GenSnapshotWithoutFactoryConfig))]
+ public void ItPassesThroughTheFactoryFromTheClass(string testMethodName)
+ {
+ var mockParametersGenFactory = MockParametersGenFactory();
+
+ TestProxy.Initialize(
+ typeof(GenSnapshotsWithFactoryConfig),
+ testMethodName,
+ parametersGenFactory: mockParametersGenFactory.Object);
+
+ VerifyFactoryPassedThrough(mockParametersGenFactory, typeof(GenFactory2));
+ }
+
+ [Theory]
+ [InlineData(nameof(GenSnapshotsWithFactoryConfig.GenSnapshotWithFactoryConfig))]
+ public void AMethodLevelFactoryIsPreferredOverAClassLevelFactory(string testMethodName)
+ {
+ var mockParametersGenFactory = MockParametersGenFactory();
+
+ TestProxy.Initialize(
+ typeof(GenSnapshotsWithFactoryConfig),
+ testMethodName,
+ parametersGenFactory: mockParametersGenFactory.Object);
+
+ VerifyFactoryPassedThrough(mockParametersGenFactory, typeof(GenFactory1));
+ }
+
+ private static Mock MockParametersGenFactory()
+ {
+ var mock = new Mock();
+
+ return mock;
+ }
+
+ private static void VerifyFactoryPassedThrough(Mock mockParametersGenFactory, Type expectedFactoryType)
+ {
+ mockParametersGenFactory.Verify(
+ x => x.CreateParametersGen(
+ It.IsAny(),
+ It.Is(factory => factory != null && factory.GetType() == expectedFactoryType),
+ It.IsAny>()),
+ Times.Once);
+ }
+
+ private static void VerifyFactoryNotPassedThrough(Mock mockParametersGenFactory)
+ {
+ mockParametersGenFactory.Verify(
+ x => x.CreateParametersGen(
+ It.IsAny(),
+ It.Is(x => x == null),
+ It.IsAny>()),
+ Times.Once);
+ }
+
+ private class GenFactory1 : IGenFactory
+ {
+ public IReflectedGen Create(NullabilityInfo? nullabilityInfo = null) where T : notnull
+ {
+ throw new NotImplementedException();
+ }
+
+ public IGenFactory RegisterType(Type type, IGen gen)
+ {
+ throw new NotImplementedException();
+ }
+
+ public IGenFactory RegisterType(IGen gen)
+ {
+ throw new NotImplementedException();
+ }
+
+ public IGenFactory RegisterType(Func> genFunc)
+ {
+ throw new NotImplementedException();
+ }
+
+ public IGenFactory RegisterType(Type type, Func genFunc)
+ {
+ throw new NotImplementedException();
+ }
+ }
+
+ private class GenFactory1Attribute : GenFactoryAttribute
+ {
+ public override IGenFactory Value => new GenFactory1();
+ }
+
+ private class GenFactory2 : IGenFactory
+ {
+ public IReflectedGen Create(NullabilityInfo? nullabilityInfo = null) where T : notnull
+ {
+ throw new NotImplementedException();
+ }
+
+ public IGenFactory RegisterType(Type type, IGen gen)
+ {
+ throw new NotImplementedException();
+ }
+
+ public IGenFactory RegisterType(IGen gen)
+ {
+ throw new NotImplementedException();
+ }
+
+ public IGenFactory RegisterType(Func> genFunc)
+ {
+ throw new NotImplementedException();
+ }
+
+ public IGenFactory RegisterType(Type type, Func genFunc)
+ {
+ throw new NotImplementedException();
+ }
+ }
+
+ private class GenFactory2Attribute : GenFactoryAttribute
+ {
+ public override IGenFactory Value => new GenFactory2();
+ }
+
+#pragma warning disable xUnit1000 // Test classes must be public
+ private class GenSnapshotsWithoutFactoryConfig
+#pragma warning restore xUnit1000 // Test classes must be public
+ {
+ [GenSnapshot]
+ [GenFactory1]
+ public object GenSnapshotWithFactoryConfig() => new { };
+
+ [GenSnapshot]
+ public object GenSnapshotWithoutFactoryConfig() => new { };
+ }
+
+ [GenFactory2]
+#pragma warning disable xUnit1000 // Test classes must be public
+ private class GenSnapshotsWithFactoryConfig
+#pragma warning restore xUnit1000 // Test classes must be public
+ {
+ [GenSnapshot]
+ [GenFactory1]
+ public object GenSnapshotWithFactoryConfig() => new { };
+
+ [GenSnapshot]
+ public object GenSnapshotWithoutFactoryConfig() => new { };
+ }
+
+
+ private static MethodInfo GetMethod(Type type, string name)
+ {
+ var methodInfo = type.GetMethod(name, BindingFlags.Public | BindingFlags.Instance);
+
+ if (methodInfo == null)
+ {
+ throw new Exception("Unable to locate method");
+ }
+
+ return methodInfo;
+ }
+ }
+}
diff --git a/src/GalaxyCheck.Xunit.Tests/GenSnapshotInitializerTests/AboutInvalidReturnTypes.cs b/src/GalaxyCheck.Xunit.Tests/GenSnapshotInitializerTests/AboutInvalidReturnTypes.cs
new file mode 100644
index 00000000..b6ceb1df
--- /dev/null
+++ b/src/GalaxyCheck.Xunit.Tests/GenSnapshotInitializerTests/AboutInvalidReturnTypes.cs
@@ -0,0 +1,47 @@
+using FluentAssertions;
+using GalaxyCheck;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Xunit;
+
+namespace Tests.GenSnapshotInitializerTests
+{
+ public class AboutInvalidReturnTypes
+ {
+#pragma warning disable xUnit1000 // Test classes must be public
+ private class GenSnapshots
+#pragma warning restore xUnit1000 // Test classes must be public
+ {
+ [GenSnapshot]
+ public void GenSnapshotVoid()
+ {
+ }
+
+ [GenSnapshot]
+ public Task GenSnapshotTaskVoid()
+ {
+ return Task.CompletedTask;
+ }
+
+ [GenSnapshot]
+ public ValueTask GenSnapshotValueTaskVoid()
+ {
+ return ValueTask.CompletedTask;
+ }
+ }
+
+ [Theory]
+ [InlineData(nameof(GenSnapshots.GenSnapshotVoid))]
+ [InlineData(nameof(GenSnapshots.GenSnapshotTaskVoid))]
+ [InlineData(nameof(GenSnapshots.GenSnapshotValueTaskVoid))]
+ public void ItPassesThroughSeedsForTheIterations(string testMethodName)
+ {
+ var action = () => TestProxy.Initialize(typeof(GenSnapshots), testMethodName);
+
+ action.Should().Throw().WithMessage("Test method must return a value for snapshotting, or a task containing a value");
+ }
+ }
+}
diff --git a/src/GalaxyCheck.Xunit.Tests/GenSnapshotInitializerTests/AboutIterations.cs b/src/GalaxyCheck.Xunit.Tests/GenSnapshotInitializerTests/AboutIterations.cs
new file mode 100644
index 00000000..d8941971
--- /dev/null
+++ b/src/GalaxyCheck.Xunit.Tests/GenSnapshotInitializerTests/AboutIterations.cs
@@ -0,0 +1,42 @@
+using FluentAssertions;
+using GalaxyCheck;
+using Xunit;
+
+namespace Tests.GenSnapshotInitializerTests
+{
+ public class AboutIterations
+ {
+#pragma warning disable xUnit1000 // Test classes must be public
+ private class GenSnapshots
+#pragma warning restore xUnit1000 // Test classes must be public
+ {
+ [GenSnapshot]
+ public object GenSnapshotWithDefaultIterations() => new { };
+
+ [GenSnapshot(Iterations = 5)]
+ public object GenSnapshotWith5Iterations() => new { };
+
+ [GenSnapshot(Iterations = 10)]
+ public object GenSnapshotWith10Iterations() => new { };
+ }
+
+ [Theory]
+ [InlineData(nameof(GenSnapshots.GenSnapshotWith5Iterations), new int[] { 0, 1, 2, 3, 4 })]
+ [InlineData(nameof(GenSnapshots.GenSnapshotWith10Iterations), new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 })]
+ public void ItPassesThroughSeedsForTheIterations(string testMethodName, int[] expectedSeeds)
+ {
+ var result = TestProxy.Initialize(typeof(GenSnapshots), testMethodName, configure: config => config.DefaultIterations = 999);
+
+ result.Seeds.Should().BeEquivalentTo(expectedSeeds);
+ }
+
+ [Theory]
+ [InlineData(nameof(GenSnapshots.GenSnapshotWithDefaultIterations))]
+ public void ItPassesThroughSeedsFromTheDefaultIterationsIfNotExplicitlySet(string testMethodName)
+ {
+ var result = TestProxy.Initialize(typeof(GenSnapshots), testMethodName, configure: config => config.DefaultIterations = 5);
+
+ result.Seeds.Should().BeEquivalentTo(new [] { 0, 1, 2, 3, 4 });
+ }
+ }
+}
diff --git a/src/GalaxyCheck.Xunit.Tests/GenSnapshotInitializerTests/AboutMemberGenAttribute.cs b/src/GalaxyCheck.Xunit.Tests/GenSnapshotInitializerTests/AboutMemberGenAttribute.cs
new file mode 100644
index 00000000..873d7223
--- /dev/null
+++ b/src/GalaxyCheck.Xunit.Tests/GenSnapshotInitializerTests/AboutMemberGenAttribute.cs
@@ -0,0 +1,134 @@
+using FluentAssertions;
+using GalaxyCheck;
+using GalaxyCheck.Gens;
+using GalaxyCheck.Internal;
+using Moq;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using Xunit;
+
+namespace Tests.GenSnapshotInitializerTests
+{
+ public class AboutMemberGenAttribute
+ {
+
+ private static readonly IGen Gen = GalaxyCheck.Gen.Int32();
+
+#pragma warning disable xUnit1000 // Test classes must be public
+ private class GenSnapshots
+#pragma warning restore xUnit1000 // Test classes must be public
+ {
+ public object NotAGen => new object();
+
+ [GenSnapshot]
+ public object GenSnapshotWithNonGenMemberGen([MemberGen(nameof(NotAGen))] int x) => new { };
+
+ public IGen GenSnapshotMemberGen => Gen;
+
+ [GenSnapshot]
+ public object GenSnapshotWithGenSnapshotMemberGen([MemberGen(nameof(GenSnapshotMemberGen))] int x) => new { };
+
+ public IGen FieldMemberGen = Gen;
+
+ [GenSnapshot]
+ public object GenSnapshotWithFieldMemberGen([MemberGen(nameof(FieldMemberGen))] int x) => new { };
+
+ public IGen PublicMemberGen => Gen;
+
+ [GenSnapshot]
+ public object GenSnapshotWithPublicMemberGen([MemberGen(nameof(PublicMemberGen))] int x) => new { };
+
+ private IGen PrivateMemberGen => Gen;
+
+ [GenSnapshot]
+ public object GenSnapshotWithPrivateMemberGen([MemberGen(nameof(PrivateMemberGen))] int x) => new { };
+
+ public IGen InstanceMemberGen => Gen;
+
+ [GenSnapshot]
+ public object GenSnapshotWithInstanceMemberGen([MemberGen(nameof(InstanceMemberGen))] int x) => new { };
+
+ public static IGen StaticMemberGen => Gen;
+
+ [GenSnapshot]
+ public object GenSnapshotWithStaticMemberGen([MemberGen(nameof(StaticMemberGen))] int x) => new { };
+
+ [GenSnapshot]
+ public object GenSnapshotWithMemberGenAtIndex0([MemberGen(nameof(GenSnapshotMemberGen))] int x, int y) => new { };
+
+ [GenSnapshot]
+ public object GenSnapshotWithMemberGenAtIndex1(int x, [MemberGen(nameof(GenSnapshotMemberGen))] int y) => new { };
+ }
+
+ [Theory]
+ [InlineData(nameof(GenSnapshots.GenSnapshotWithNonGenMemberGen))]
+ public void ItErrorsWhenReferenceGenSnapshotIsNotAGen(string testMethodName)
+ {
+ Action test = () => TestProxy.Initialize(typeof(GenSnapshots), testMethodName);
+
+ test.Should()
+ .Throw()
+ .WithMessage("Expected member 'NotAGen' to be an instance of 'GalaxyCheck.IGen', but it had a value of type 'System.Object'");
+ }
+
+
+ [Theory]
+ [InlineData(nameof(GenSnapshots.GenSnapshotWithGenSnapshotMemberGen))]
+ [InlineData(nameof(GenSnapshots.GenSnapshotWithFieldMemberGen))]
+ [InlineData(nameof(GenSnapshots.GenSnapshotWithPublicMemberGen))]
+ [InlineData(nameof(GenSnapshots.GenSnapshotWithPrivateMemberGen))]
+ [InlineData(nameof(GenSnapshots.GenSnapshotWithInstanceMemberGen))]
+ [InlineData(nameof(GenSnapshots.GenSnapshotWithStaticMemberGen))]
+ public void ItPassesThroughGen(string testMethodName)
+ {
+ var mockGenSnapshotFactory = MockGenSnapshotFactory();
+
+ TestProxy.Initialize(typeof(GenSnapshots), testMethodName, parametersGenFactory: mockGenSnapshotFactory.Object);
+
+ VerifyGenPassedThrough(mockGenSnapshotFactory, Gen, 0);
+ }
+
+ [Theory]
+ [InlineData(nameof(GenSnapshots.GenSnapshotWithMemberGenAtIndex0), 0)]
+ [InlineData(nameof(GenSnapshots.GenSnapshotWithMemberGenAtIndex1), 1)]
+ public void ItPassesThroughGenKeyedToCorrectIndex(string testMethodName, int expectedIndex)
+ {
+ var mockGenSnapshotFactory = MockGenSnapshotFactory();
+
+ TestProxy.Initialize(typeof(GenSnapshots), testMethodName, parametersGenFactory: mockGenSnapshotFactory.Object);
+
+ VerifyGenPassedThrough(mockGenSnapshotFactory, Gen, expectedIndex);
+ }
+
+ private static MethodInfo GetMethod(string name)
+ {
+ var methodInfo = typeof(GenSnapshots).GetMethod(name, BindingFlags.Instance | BindingFlags.Public);
+
+ if (methodInfo == null)
+ {
+ throw new Exception("Unable to locate method");
+ }
+
+ return methodInfo;
+ }
+
+ private static Mock MockGenSnapshotFactory()
+ {
+ var mock = new Mock();
+
+ return mock;
+ }
+
+ private static void VerifyGenPassedThrough(Mock mockGenSnapshotFactory, IGen expectedGen, int expectedParameterIndex)
+ {
+ mockGenSnapshotFactory.Verify(
+ x => x.CreateParametersGen(
+ It.IsAny(),
+ It.IsAny(),
+ It.Is>(x => x.SequenceEqual(new [] { new KeyValuePair(expectedParameterIndex, expectedGen) }))),
+ Times.Once);
+ }
+ }
+}
diff --git a/src/GalaxyCheck.Xunit.Tests/GenSnapshotInitializerTests/AboutSize.cs b/src/GalaxyCheck.Xunit.Tests/GenSnapshotInitializerTests/AboutSize.cs
new file mode 100644
index 00000000..a2903369
--- /dev/null
+++ b/src/GalaxyCheck.Xunit.Tests/GenSnapshotInitializerTests/AboutSize.cs
@@ -0,0 +1,42 @@
+using FluentAssertions;
+using GalaxyCheck;
+using Xunit;
+
+namespace Tests.GenSnapshotInitializerTests
+{
+ public class AboutSize
+ {
+#pragma warning disable xUnit1000 // Test classes must be public
+ private class GenSnapshots
+#pragma warning restore xUnit1000 // Test classes must be public
+ {
+ [GenSnapshot]
+ public object GenSnapshotWithDefaultSize() => new { };
+
+ [GenSnapshot(Size = 0)]
+ public object GenSnapshotWithSize0() => new { };
+
+ [GenSnapshot(Size = 10)]
+ public object GenSnapshotWithSize10() => new { };
+ }
+
+ [Theory]
+ [InlineData(nameof(GenSnapshots.GenSnapshotWithSize0), 0)]
+ [InlineData(nameof(GenSnapshots.GenSnapshotWithSize10), 10)]
+ public void ItPassesThroughSize(string testMethodName, int expectedSize)
+ {
+ var result = TestProxy.Initialize(typeof(GenSnapshots), testMethodName);
+
+ result.Size.Should().Be(expectedSize);
+ }
+
+ [Theory]
+ [InlineData(nameof(GenSnapshots.GenSnapshotWithDefaultSize))]
+ public void ItPassesThroughTheDefaultSizeIfNotExplicitlySet(string testMethodName)
+ {
+ var result = TestProxy.Initialize(typeof(GenSnapshots), testMethodName, configure: config => config.DefaultSize = 66);
+
+ result.Size.Should().Be(66);
+ }
+ }
+}
diff --git a/src/GalaxyCheck.Xunit.Tests/GenSnapshotInitializerTests/TestProxy.cs b/src/GalaxyCheck.Xunit.Tests/GenSnapshotInitializerTests/TestProxy.cs
new file mode 100644
index 00000000..5f692391
--- /dev/null
+++ b/src/GalaxyCheck.Xunit.Tests/GenSnapshotInitializerTests/TestProxy.cs
@@ -0,0 +1,43 @@
+using GalaxyCheck.Internal;
+using Moq;
+using System;
+using System.Reflection;
+using System.Threading.Tasks;
+
+namespace Tests.GenSnapshotInitializerTests
+{
+ internal static class TestProxy
+ {
+ internal static GenSnapshotInitializationResult Initialize(
+ Type testClassType,
+ string testMethodName,
+ IParametersGenFactory? parametersGenFactory = null,
+ Action? configure = null)
+ {
+ var config = new GlobalGenSnapshotConfiguration
+ {
+ AssertSnapshotMatches = (_) => Task.CompletedTask
+ };
+ configure?.Invoke(config);
+
+ return GenSnapshotInitializer.Initialize(
+ testClassType,
+ GetMethod(testClassType, testMethodName),
+ new object[] { },
+ parametersGenFactory ?? new Mock().Object,
+ config);
+ }
+
+ private static MethodInfo GetMethod(Type type, string name)
+ {
+ var methodInfo = type.GetMethod(name, BindingFlags.Instance | BindingFlags.Public);
+
+ if (methodInfo == null)
+ {
+ throw new Exception("Unable to locate method");
+ }
+
+ return methodInfo;
+ }
+ }
+}
diff --git a/src/GalaxyCheck.Xunit.Tests/GlobalConfigurationTests/AboutLocatingGlobalConfiguration.cs b/src/GalaxyCheck.Xunit.Tests/GlobalConfigurationTests/AboutLocatingGlobalConfiguration.cs
index 42e1c6c0..1ebdb360 100644
--- a/src/GalaxyCheck.Xunit.Tests/GlobalConfigurationTests/AboutLocatingGlobalConfiguration.cs
+++ b/src/GalaxyCheck.Xunit.Tests/GlobalConfigurationTests/AboutLocatingGlobalConfiguration.cs
@@ -12,7 +12,7 @@ public void ItWorks()
{
var instance = GlobalConfiguration.Instance;
- instance.DefaultIterations.Should().Be(420);
+ instance.Properties.DefaultIterations.Should().Be(420);
}
}
@@ -20,7 +20,7 @@ public class MyConfigureGlobal : IConfigureGlobal
{
public void Configure(IGlobalConfiguration instance)
{
- instance.DefaultIterations = 420;
+ instance.Properties.DefaultIterations = 420;
}
}
}
diff --git a/src/GalaxyCheck.Xunit.Tests/IntegrationSample/ConfigureGalaxyCheck.cs b/src/GalaxyCheck.Xunit.Tests/IntegrationSample/ConfigureGalaxyCheck.cs
deleted file mode 100644
index 31dc7221..00000000
--- a/src/GalaxyCheck.Xunit.Tests/IntegrationSample/ConfigureGalaxyCheck.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-using GalaxyCheck.Configuration;
-
-namespace IntegrationSample
-{
- internal class ConfigureGalaxyCheck : IConfigureGlobal
- {
- public void Configure(IGlobalConfiguration instance)
- {
- instance.DefaultIterations = 100;
- }
- }
-}
diff --git a/src/GalaxyCheck.Xunit.Tests/IntegrationTests.cs b/src/GalaxyCheck.Xunit.Tests/IntegrationTests.cs
deleted file mode 100644
index 786ce897..00000000
--- a/src/GalaxyCheck.Xunit.Tests/IntegrationTests.cs
+++ /dev/null
@@ -1,127 +0,0 @@
-using FluentAssertions;
-using System;
-using System.Collections.Generic;
-using System.Collections.Immutable;
-using System.Diagnostics;
-using System.IO;
-using System.Linq;
-using System.Threading.Tasks;
-using System.Xml.Linq;
-using Xunit;
-
-namespace Tests
-{
- public class IntegrationTests : IClassFixture
- {
- private readonly TestSuiteFixture _fixture;
-
- public IntegrationTests(TestSuiteFixture fixture)
- {
- _fixture = fixture;
- }
-
- [Theory]
- [InlineData("InfallibleVoidProperty")]
- [InlineData("InfallibleVoidPropertyAsync")]
- [InlineData("InfallibleBooleanProperty")]
- [InlineData("InfallibleBooleanPropertyAsync")]
- [InlineData("InfallibleReturnedProperty")]
- [InlineData("InfallibleReturnedPropertyAsync")]
- [InlineData("PropertyWithGenFromGenFactory")]
- [InlineData("PropertyWithGenFromGenFactoryAsync")]
- [InlineData("PropertyWithGenFromMemberGen")]
- [InlineData("PropertyWithGenFromMemberGenAsync")]
- public void PassingProperties(string testName)
- {
- var testResult = _fixture.FindTestResult(testName);
-
- testResult.Outcome.Should().Be("Passed");
- }
-
- [Theory]
- [InlineData("FallibleVoidProperty")]
- [InlineData("FallibleVoidPropertyAsync")]
- [InlineData("FallibleBooleanProperty")]
- [InlineData("FallibleBooleanPropertyAsync")]
- [InlineData("FallibleReturnedProperty")]
- [InlineData("FallibleReturnedPropertyAsync")]
- public void FailingProperties(string testName)
- {
- var testResult = _fixture.FindTestResult(testName);
-
- testResult.Outcome.Should().Be("Failed");
- testResult.Message.Should().StartWith("GalaxyCheck.Runners.PropertyFailedException");
- }
-
- [Theory]
- [InlineData("SampleVoidProperty")]
- [InlineData("SampleVoidPropertyAsync")]
- public void SampledProperties(string testName)
- {
- var testResult = _fixture.FindTestResult(testName);
-
- testResult.Outcome.Should().Be("Failed");
- testResult.Message.Should().StartWith("GalaxyCheck.SampleException : Test case failed to prevent false-positives.");
- }
-
- public record Invocation(object[] InjectedParameters);
-
- public record TestResult(string TestName, string Outcome, string Message, ImmutableList Invocations);
-
- public class TestSuiteFixture : IAsyncLifetime
- {
- private static readonly string CurrentDirectory = Directory.GetCurrentDirectory();
- private static readonly string TestReportFileName = Path.Combine(CurrentDirectory, $"test_result_{DateTime.UtcNow.Ticks}.trx");
-
- public ImmutableList TestResults { get; private set; } = default!;
-
- public async Task InitializeAsync()
- {
- var currentProjectDir = Enumerable
- .Range(0, 3)
- .Aggregate(new DirectoryInfo(CurrentDirectory), (acc, _) => acc.Parent!);
- var integrationProjectDir = Path.Combine(currentProjectDir.FullName, "IntegrationSample");
-
- var testProcess = Process.Start(new ProcessStartInfo
- {
- FileName = "dotnet",
- Arguments = $"test {integrationProjectDir} --logger \"trx;LogFileName={TestReportFileName}\"",
- RedirectStandardOutput = true,
- RedirectStandardError = true,
- });
-
- var standardOutput = await testProcess!.StandardOutput.ReadToEndAsync();
- var standardError = await testProcess!.StandardError.ReadToEndAsync();
-
- var testReport = File.ReadAllText(TestReportFileName);
-
- var testResults =
- from descendent in XElement.Parse(testReport).Descendants()
- where descendent.Name.LocalName == "UnitTestResult"
- select ElementToTestResult(descendent);
-
- TestResults = testResults.ToImmutableList();
- }
-
- public Task DisposeAsync() => Task.CompletedTask;
-
- public TestResult FindTestResult(string testName) => TestResults.Single(x => x.TestName == testName);
-
- private static TestResult ElementToTestResult(XElement element)
- {
- var attributes = element.Attributes();
-
- var message = (
- from desc in element.Descendants()
- where desc.Name.LocalName.Contains("Message")
- select desc.Value).SingleOrDefault();
-
- return new TestResult(
- attributes.Single(a => a.Name.LocalName.Contains("testName")).Value.Split('.').Last(),
- attributes.Single(a => a.Name.LocalName.Contains("outcome")).Value,
- message!,
- new List().ToImmutableList());
- }
- }
- }
-}
diff --git a/src/GalaxyCheck.Xunit.Tests/IntegrationTests/GenSnapshotTests.Snapshooter.cs b/src/GalaxyCheck.Xunit.Tests/IntegrationTests/GenSnapshotTests.Snapshooter.cs
new file mode 100644
index 00000000..c16fc0f1
--- /dev/null
+++ b/src/GalaxyCheck.Xunit.Tests/IntegrationTests/GenSnapshotTests.Snapshooter.cs
@@ -0,0 +1,34 @@
+using FluentAssertions;
+using Xunit;
+
+namespace Tests.IntegrationTests
+{
+ public class GenSnapshotTestsSnapshooter : IClassFixture
+ {
+ public class Fixture : TestSuiteFixture
+ {
+ public Fixture() : base("IntegrationSample_GenSnaphot_Snapshooter")
+ {
+ }
+ }
+
+ private readonly Fixture _fixture;
+
+ public GenSnapshotTestsSnapshooter(Fixture fixture)
+ {
+ _fixture = fixture;
+ }
+
+ [Theory]
+ [InlineData("TypedOutput")]
+ [InlineData("ObjectOutput")]
+ [InlineData("TaskOutput")]
+ [InlineData("ValueTaskOuput")]
+ public void Snapshots(string testName)
+ {
+ var testResult = _fixture.FindTestResult(testName);
+
+ testResult.Outcome.Should().Be("Passed");
+ }
+ }
+}
diff --git a/src/GalaxyCheck.Xunit.Tests/IntegrationTests/PropertyTests.cs b/src/GalaxyCheck.Xunit.Tests/IntegrationTests/PropertyTests.cs
new file mode 100644
index 00000000..25af8e50
--- /dev/null
+++ b/src/GalaxyCheck.Xunit.Tests/IntegrationTests/PropertyTests.cs
@@ -0,0 +1,66 @@
+using FluentAssertions;
+using Xunit;
+
+namespace Tests.IntegrationTests
+{
+ public class PropertyTests : IClassFixture
+ {
+ public class Fixture : TestSuiteFixture
+ {
+ public Fixture() : base("IntegrationSample")
+ {
+ }
+ }
+
+ private readonly Fixture _fixture;
+
+ public PropertyTests(Fixture fixture)
+ {
+ _fixture = fixture;
+ }
+
+ [Theory]
+ [InlineData("InfallibleVoidProperty")]
+ [InlineData("InfallibleVoidPropertyAsync")]
+ [InlineData("InfallibleBooleanProperty")]
+ [InlineData("InfallibleBooleanPropertyAsync")]
+ [InlineData("InfallibleReturnedProperty")]
+ [InlineData("InfallibleReturnedPropertyAsync")]
+ [InlineData("PropertyWithGenFromGenFactory")]
+ [InlineData("PropertyWithGenFromGenFactoryAsync")]
+ [InlineData("PropertyWithGenFromMemberGen")]
+ [InlineData("PropertyWithGenFromMemberGenAsync")]
+ public void PassingProperties(string testName)
+ {
+ var testResult = _fixture.FindTestResult(testName);
+
+ testResult.Outcome.Should().Be("Passed");
+ }
+
+ [Theory]
+ [InlineData("FallibleVoidProperty")]
+ [InlineData("FallibleVoidPropertyAsync")]
+ [InlineData("FallibleBooleanProperty")]
+ [InlineData("FallibleBooleanPropertyAsync")]
+ [InlineData("FallibleReturnedProperty")]
+ [InlineData("FallibleReturnedPropertyAsync")]
+ public void FailingProperties(string testName)
+ {
+ var testResult = _fixture.FindTestResult(testName);
+
+ testResult.Outcome.Should().Be("Failed");
+ testResult.Message.Should().StartWith("GalaxyCheck.Runners.PropertyFailedException");
+ }
+
+ [Theory]
+ [InlineData("SampleVoidProperty")]
+ [InlineData("SampleVoidPropertyAsync")]
+ public void SampledProperties(string testName)
+ {
+ var testResult = _fixture.FindTestResult(testName);
+
+ testResult.Outcome.Should().Be("Failed");
+ testResult.Message.Should().StartWith("GalaxyCheck.SampleException : Test case failed to prevent false-positives.");
+ }
+ }
+}
diff --git a/src/GalaxyCheck.Xunit.Tests/IntegrationTests/TestSuiteFixture.cs b/src/GalaxyCheck.Xunit.Tests/IntegrationTests/TestSuiteFixture.cs
new file mode 100644
index 00000000..339d5c57
--- /dev/null
+++ b/src/GalaxyCheck.Xunit.Tests/IntegrationTests/TestSuiteFixture.cs
@@ -0,0 +1,79 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.Immutable;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Xml.Linq;
+using Xunit;
+
+namespace Tests.IntegrationTests
+{
+ public record Invocation(object[] InjectedParameters);
+
+ public record TestResult(string TestName, string Outcome, string Message, ImmutableList Invocations);
+
+ public abstract class TestSuiteFixture : IAsyncLifetime
+ {
+ private readonly string _currentDirectory = Directory.GetCurrentDirectory();
+ private readonly string _testReportFileName;
+ private readonly string _testSuiteName;
+
+ public TestSuiteFixture(string testSuiteName)
+ {
+ _testReportFileName = Path.Combine(_currentDirectory, $"test_result_{testSuiteName}_{DateTime.UtcNow.Ticks}.trx");
+ _testSuiteName = testSuiteName;
+ }
+
+ public ImmutableList TestResults { get; private set; } = default!;
+
+ public async Task InitializeAsync()
+ {
+ var currentProjectDir = Enumerable
+ .Range(0, 3)
+ .Aggregate(new DirectoryInfo(_currentDirectory), (acc, _) => acc.Parent!);
+ var integrationProjectDir = Path.Combine(currentProjectDir.FullName, "samples", _testSuiteName);
+
+ var testProcess = Process.Start(new ProcessStartInfo
+ {
+ FileName = "dotnet",
+ Arguments = $"test {integrationProjectDir} --logger \"trx;LogFileName={_testReportFileName}\"",
+ RedirectStandardOutput = true,
+ RedirectStandardError = true,
+ });
+
+ var standardOutput = await testProcess!.StandardOutput.ReadToEndAsync();
+ var standardError = await testProcess!.StandardError.ReadToEndAsync();
+
+ var testReport = File.ReadAllText(_testReportFileName);
+
+ var testResults =
+ from descendent in XElement.Parse(testReport).Descendants()
+ where descendent.Name.LocalName == "UnitTestResult"
+ select ElementToTestResult(descendent);
+
+ TestResults = testResults.ToImmutableList();
+ }
+
+ public Task DisposeAsync() => Task.CompletedTask;
+
+ public TestResult FindTestResult(string testName) => TestResults.Single(x => x.TestName == testName);
+
+ private static TestResult ElementToTestResult(XElement element)
+ {
+ var attributes = element.Attributes();
+
+ var message = (
+ from desc in element.Descendants()
+ where desc.Name.LocalName.Contains("Message")
+ select desc.Value).SingleOrDefault();
+
+ return new TestResult(
+ attributes.Single(a => a.Name.LocalName.Contains("testName")).Value.Split('.').Last(),
+ attributes.Single(a => a.Name.LocalName.Contains("outcome")).Value,
+ message!,
+ new List().ToImmutableList());
+ }
+ }
+}
diff --git a/src/GalaxyCheck.Xunit.Tests/PropertyInitializerTests/AboutFactory.cs b/src/GalaxyCheck.Xunit.Tests/PropertyInitializerTests/AboutFactory.cs
index 2595d851..4facc712 100644
--- a/src/GalaxyCheck.Xunit.Tests/PropertyInitializerTests/AboutFactory.cs
+++ b/src/GalaxyCheck.Xunit.Tests/PropertyInitializerTests/AboutFactory.cs
@@ -18,14 +18,14 @@ public void WhenClassNorMethodHasFactoryConfig_ItPassesThroughNull(string testMe
{
var mockPropertyFactory = MockPropertyFactory();
var testClassType = typeof(PropertiesWithoutFactoryConfig);
- var testMethodInfo = GetMethod(testMethodName);
+ var testMethodInfo = GetMethod(testClassType, testMethodName);
PropertyInitializer.Initialize(
testClassType,
testMethodInfo,
new object[] { },
mockPropertyFactory.Object,
- new GlobalConfiguration());
+ new GlobalPropertyConfiguration());
VerifyFactoryNotPassedThrough(mockPropertyFactory);
}
@@ -37,14 +37,14 @@ public void ItPassesThroughTheFactoryFromTheMethod(string testMethodName)
{
var mockPropertyFactory = MockPropertyFactory();
var testClassType = typeof(PropertiesWithoutFactoryConfig);
- var testMethodInfo = GetMethod(testMethodName);
+ var testMethodInfo = GetMethod(testClassType, testMethodName);
PropertyInitializer.Initialize(
testClassType,
testMethodInfo,
new object[] { },
mockPropertyFactory.Object,
- new GlobalConfiguration());
+ new GlobalPropertyConfiguration());
VerifyFactoryPassedThrough(mockPropertyFactory, typeof(GenFactory1));
}
@@ -56,14 +56,14 @@ public void ItPassesThroughTheFactoryFromTheClass(string testMethodName)
{
var mockPropertyFactory = MockPropertyFactory();
var testClassType = typeof(PropertiesWithFactoryConfig);
- var testMethodInfo = GetMethod(testMethodName);
+ var testMethodInfo = GetMethod(testClassType, testMethodName);
PropertyInitializer.Initialize(
testClassType,
testMethodInfo,
new object[] { },
mockPropertyFactory.Object,
- new GlobalConfiguration());
+ new GlobalPropertyConfiguration());
VerifyFactoryPassedThrough(mockPropertyFactory, typeof(GenFactory2));
}
@@ -75,14 +75,14 @@ public void AMethodLevelFactoryIsPreferredOverAClassLevelFactory(string testMeth
{
var mockPropertyFactory = MockPropertyFactory();
var testClassType = typeof(PropertiesWithFactoryConfig);
- var testMethodInfo = GetMethod(testMethodName);
+ var testMethodInfo = GetMethod(testClassType, testMethodName);
PropertyInitializer.Initialize(
testClassType,
testMethodInfo,
new object[] { },
mockPropertyFactory.Object,
- new GlobalConfiguration());
+ new GlobalPropertyConfiguration());
VerifyFactoryPassedThrough(mockPropertyFactory, typeof(GenFactory1));
}
@@ -238,9 +238,9 @@ public void SampleWithoutFactoryConfig()
}
- private static MethodInfo GetMethod(string name)
+ private static MethodInfo GetMethod(Type type, string name)
{
- var methodInfo = typeof(PropertiesWithoutFactoryConfig).GetMethod(name, BindingFlags.Public | BindingFlags.Instance);
+ var methodInfo = type.GetMethod(name, BindingFlags.Public | BindingFlags.Instance);
if (methodInfo == null)
{
diff --git a/src/GalaxyCheck.Xunit.Tests/PropertyInitializerTests/AboutIterations.cs b/src/GalaxyCheck.Xunit.Tests/PropertyInitializerTests/AboutIterations.cs
index f0c01c18..fe5dd414 100644
--- a/src/GalaxyCheck.Xunit.Tests/PropertyInitializerTests/AboutIterations.cs
+++ b/src/GalaxyCheck.Xunit.Tests/PropertyInitializerTests/AboutIterations.cs
@@ -47,7 +47,7 @@ public void ItPassesThroughIterations(string testMethodName, int expectedIterati
testMethodInfo,
new object[] { },
new DefaultPropertyFactory(),
- new GlobalConfiguration { DefaultIterations = 999 });
+ new GlobalPropertyConfiguration { DefaultIterations = 999 });
result.Parameters.Iterations.Should().Be(expectedIterations);
}
@@ -66,7 +66,7 @@ public void ItPassesThroughTheDefaultIterationsIfNotExplicitlySet(string testMet
testMethodInfo,
new object[] { },
new DefaultPropertyFactory(),
- new GlobalConfiguration { DefaultIterations = defaultIterations });
+ new GlobalPropertyConfiguration { DefaultIterations = defaultIterations });
result.Parameters.Iterations.Should().Be(defaultIterations);
}
diff --git a/src/GalaxyCheck.Xunit.Tests/PropertyInitializerTests/AboutMemberGenAttribute.cs b/src/GalaxyCheck.Xunit.Tests/PropertyInitializerTests/AboutMemberGenAttribute.cs
index e445e20f..5a0242fa 100644
--- a/src/GalaxyCheck.Xunit.Tests/PropertyInitializerTests/AboutMemberGenAttribute.cs
+++ b/src/GalaxyCheck.Xunit.Tests/PropertyInitializerTests/AboutMemberGenAttribute.cs
@@ -92,7 +92,7 @@ public void ItErrorsWhenReferencePropertyIsNotAGen(string testMethodName)
testMethodInfo,
new object[] { },
new DefaultPropertyFactory(),
- new GlobalConfiguration());
+ new GlobalPropertyConfiguration());
test.Should()
.Throw()
@@ -118,7 +118,7 @@ public void ItPassesThroughGen(string testMethodName)
testMethodInfo,
new object[] { },
mockPropertyFactory.Object,
- new GlobalConfiguration());
+ new GlobalPropertyConfiguration());
VerifyGenPassedThrough(mockPropertyFactory, Gen, 0);
}
@@ -132,7 +132,7 @@ public void ItPassesThroughGenKeyedToCorrectIndex(string testMethodName, int exp
var testClassType = typeof(Properties);
var testMethodInfo = GetMethod(testMethodName);
- PropertyInitializer.Initialize(testClassType, testMethodInfo, new object[] { }, mockPropertyFactory.Object, new GlobalConfiguration());
+ PropertyInitializer.Initialize(testClassType, testMethodInfo, new object[] { }, mockPropertyFactory.Object, new GlobalPropertyConfiguration());
VerifyGenPassedThrough(mockPropertyFactory, Gen, expectedIndex);
}
diff --git a/src/GalaxyCheck.Xunit.Tests/PropertyInitializerTests/AboutReplay.cs b/src/GalaxyCheck.Xunit.Tests/PropertyInitializerTests/AboutReplay.cs
index bb40b819..56e09cc2 100644
--- a/src/GalaxyCheck.Xunit.Tests/PropertyInitializerTests/AboutReplay.cs
+++ b/src/GalaxyCheck.Xunit.Tests/PropertyInitializerTests/AboutReplay.cs
@@ -51,7 +51,7 @@ public void ItPassesThroughReplay(string testMethodName, string? expectedReplay)
testMethodInfo,
new object[] { },
new DefaultPropertyFactory(),
- new GlobalConfiguration());
+ new GlobalPropertyConfiguration());
result.Parameters.Replay.Should().Be(expectedReplay);
}
diff --git a/src/GalaxyCheck.Xunit.Tests/PropertyInitializerTests/AboutSeed.cs b/src/GalaxyCheck.Xunit.Tests/PropertyInitializerTests/AboutSeed.cs
index 19c22858..3f800d60 100644
--- a/src/GalaxyCheck.Xunit.Tests/PropertyInitializerTests/AboutSeed.cs
+++ b/src/GalaxyCheck.Xunit.Tests/PropertyInitializerTests/AboutSeed.cs
@@ -71,7 +71,7 @@ public void ItPassesThroughSeed(string testMethodName, int expectedSeed)
testMethodInfo,
new object[] { },
new DefaultPropertyFactory(),
- new GlobalConfiguration());
+ new GlobalPropertyConfiguration());
result.Parameters.Seed.Should().Be(expectedSeed);
}
@@ -91,7 +91,7 @@ public void ItDoesNotPassThroughSeed(string testMethodName)
testMethodInfo,
new object[] { },
new DefaultPropertyFactory(),
- new GlobalConfiguration());
+ new GlobalPropertyConfiguration());
result.Parameters.Seed.Should().Be(null);
}
diff --git a/src/GalaxyCheck.Xunit.Tests/PropertyInitializerTests/AboutShrinkLimit.cs b/src/GalaxyCheck.Xunit.Tests/PropertyInitializerTests/AboutShrinkLimit.cs
index 53e382fc..152ab7f3 100644
--- a/src/GalaxyCheck.Xunit.Tests/PropertyInitializerTests/AboutShrinkLimit.cs
+++ b/src/GalaxyCheck.Xunit.Tests/PropertyInitializerTests/AboutShrinkLimit.cs
@@ -47,7 +47,7 @@ public void ItPassesThroughShrinkLimit(string testMethodName, int expectedShrink
testMethodInfo,
new object[] { },
new DefaultPropertyFactory(),
- new GlobalConfiguration() { DefaultShrinkLimit = 999 });
+ new GlobalPropertyConfiguration() { DefaultShrinkLimit = 999 });
result.Parameters.ShrinkLimit.Should().Be(expectedShrinkLimit);
}
@@ -66,7 +66,7 @@ public void ItPassesThroughTheDefaultShrinkLimitIfNotExplicitlySet(string testMe
testMethodInfo,
new object[] { },
new DefaultPropertyFactory(),
- new GlobalConfiguration { DefaultShrinkLimit = defaultShrinkLimit });
+ new GlobalPropertyConfiguration { DefaultShrinkLimit = defaultShrinkLimit });
result.Parameters.ShrinkLimit.Should().Be(defaultShrinkLimit);
}
diff --git a/src/GalaxyCheck.Xunit.Tests/PropertyInitializerTests/AboutSize.cs b/src/GalaxyCheck.Xunit.Tests/PropertyInitializerTests/AboutSize.cs
index b126113d..88468b47 100644
--- a/src/GalaxyCheck.Xunit.Tests/PropertyInitializerTests/AboutSize.cs
+++ b/src/GalaxyCheck.Xunit.Tests/PropertyInitializerTests/AboutSize.cs
@@ -71,7 +71,7 @@ public void ItPassesThroughSize(string testMethodName, int expectedSize)
testMethodInfo,
new object[] { },
new DefaultPropertyFactory(),
- new GlobalConfiguration());
+ new GlobalPropertyConfiguration());
result.Parameters.Size.Should().Be(expectedSize);
}
@@ -91,7 +91,7 @@ public void ItDoesNotPassThroughSize(string testMethodName)
testMethodInfo,
new object[] { },
new DefaultPropertyFactory(),
- new GlobalConfiguration());
+ new GlobalPropertyConfiguration());
result.Parameters.Size.Should().Be(null);
}
diff --git a/src/GalaxyCheck.Xunit.Tests/IntegrationSample/AsyncTests.cs b/src/GalaxyCheck.Xunit.Tests/samples/IntegrationSample/AsyncTests.cs
similarity index 100%
rename from src/GalaxyCheck.Xunit.Tests/IntegrationSample/AsyncTests.cs
rename to src/GalaxyCheck.Xunit.Tests/samples/IntegrationSample/AsyncTests.cs
diff --git a/src/GalaxyCheck.Xunit.Tests/IntegrationSample/IntegrationSample.csproj b/src/GalaxyCheck.Xunit.Tests/samples/IntegrationSample/IntegrationSample.csproj
similarity index 85%
rename from src/GalaxyCheck.Xunit.Tests/IntegrationSample/IntegrationSample.csproj
rename to src/GalaxyCheck.Xunit.Tests/samples/IntegrationSample/IntegrationSample.csproj
index 0a52f549..d4261cf9 100644
--- a/src/GalaxyCheck.Xunit.Tests/IntegrationSample/IntegrationSample.csproj
+++ b/src/GalaxyCheck.Xunit.Tests/samples/IntegrationSample/IntegrationSample.csproj
@@ -1,4 +1,4 @@
-
+
net6.0
@@ -21,7 +21,7 @@
-
+
-
+
\ No newline at end of file
diff --git a/src/GalaxyCheck.Xunit.Tests/IntegrationSample/IntegrationSample.sln b/src/GalaxyCheck.Xunit.Tests/samples/IntegrationSample/IntegrationSample.sln
similarity index 90%
rename from src/GalaxyCheck.Xunit.Tests/IntegrationSample/IntegrationSample.sln
rename to src/GalaxyCheck.Xunit.Tests/samples/IntegrationSample/IntegrationSample.sln
index 8694a259..9e3b2887 100644
--- a/src/GalaxyCheck.Xunit.Tests/IntegrationSample/IntegrationSample.sln
+++ b/src/GalaxyCheck.Xunit.Tests/samples/IntegrationSample/IntegrationSample.sln
@@ -5,9 +5,9 @@ VisualStudioVersion = 16.0.31005.135
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntegrationSample", "IntegrationSample.csproj", "{055541A6-7C18-4DE2-AD25-F0A35DF5D658}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GalaxyCheck.Xunit", "..\..\..\src\GalaxyCheck.Xunit\GalaxyCheck.Xunit.csproj", "{A20D447D-C4FA-4834-BDA5-DD585FA94AC4}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GalaxyCheck.Xunit", "..\..\..\..\src\GalaxyCheck.Xunit\GalaxyCheck.Xunit.csproj", "{A20D447D-C4FA-4834-BDA5-DD585FA94AC4}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GalaxyCheck", "..\..\..\src\GalaxyCheck\GalaxyCheck.csproj", "{D688A425-1F1F-45E4-AAB3-4C00096B403A}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GalaxyCheck", "..\..\..\..\src\GalaxyCheck\GalaxyCheck.csproj", "{D688A425-1F1F-45E4-AAB3-4C00096B403A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
diff --git a/src/GalaxyCheck.Xunit.Tests/IntegrationSample/Tests.cs b/src/GalaxyCheck.Xunit.Tests/samples/IntegrationSample/Tests.cs
similarity index 100%
rename from src/GalaxyCheck.Xunit.Tests/IntegrationSample/Tests.cs
rename to src/GalaxyCheck.Xunit.Tests/samples/IntegrationSample/Tests.cs
diff --git a/src/GalaxyCheck.Xunit.Tests/samples/IntegrationSample_GenSnaphot_Snapshooter/AsyncGenSnapshotTests.cs b/src/GalaxyCheck.Xunit.Tests/samples/IntegrationSample_GenSnaphot_Snapshooter/AsyncGenSnapshotTests.cs
new file mode 100644
index 00000000..cce56988
--- /dev/null
+++ b/src/GalaxyCheck.Xunit.Tests/samples/IntegrationSample_GenSnaphot_Snapshooter/AsyncGenSnapshotTests.cs
@@ -0,0 +1,24 @@
+using GalaxyCheck;
+using System.Threading.Tasks;
+
+namespace IntegrationSample
+{
+ public class AsyncGenSnapshotTests
+ {
+ public record GeneratedInput(int Integer, int Integer2, int Integer3);
+
+ [GenSnapshot(Iterations = 1)]
+ public async Task