From f89e77ae184a3f937c56d253962b7701f3fd6fe0 Mon Sep 17 00:00:00 2001 From: Lars Date: Mon, 28 Aug 2023 16:16:41 +0200 Subject: [PATCH] chore: simplify integration tests versioning (#693) --- .editorconfig | 10 ++++ .gitattributes | 3 + .github/workflows/test.yml | 2 + docs/docs/contributing/common-tasks.md | 9 +-- docs/docs/contributing/tests.md | 10 +++- .../BaseMapperTest.cs | 55 +++++++++++++++++-- .../DeepCloningMapperTest.cs | 3 + .../Helpers/VersionedSnapshotAttribute.cs | 22 ++++++++ .../Helpers/Versions.cs | 12 ++++ .../MapperTest.cs | 2 + .../ProjectionMapperTest.cs | 32 ++++++++--- .../StaticMapperTest.cs | 4 ++ ...erTest.SnapshotGeneratedSource.verified.cs | 0 ...pperTest.RunMappingShouldWork.verified.txt | 2 +- ....RunMappingShouldWork_NET6_0.verified.txt} | 2 +- ....RunMappingShouldWork_NET7_0.verified.txt} | 2 +- ...erTest.SnapshotGeneratedSource.verified.cs | 0 ...napshotGeneratedSource_NET6_0.verified.cs} | 0 ...napshotGeneratedSource_NET7_0.verified.cs} | 2 +- ...pperTest.RunMappingShouldWork.verified.txt | 2 +- ....RunMappingShouldWork_NET6_0.verified.txt} | 2 +- ....RunMappingShouldWork_NET7_0.verified.txt} | 2 +- ...erTest.SnapshotGeneratedSource.verified.cs | 0 ...napshotGeneratedSource_NET6_0.verified.cs} | 2 +- ...napshotGeneratedSource_NET7_0.verified.cs} | 0 ...erTest.SnapshotGeneratedSource.verified.cs | 27 --------- ...erTest.SnapshotGeneratedSource.verified.cs | 18 ------ ...erTest.SnapshotGeneratedSource.verified.cs | 0 ...jectionShouldTranslateToQuery.verified.sql | 3 + ...ctionShouldTranslateToResult.verified.txt} | 0 ...ectionShouldTranslateToQuery.verified.sql} | 0 ...ctionShouldTranslateToResult.verified.txt} | 0 ...erTest.SnapshotGeneratedSource.verified.cs | 2 +- ...napshotGeneratedSource_NET6_0.verified.cs} | 0 ...napshotGeneratedSource_NET7_0.verified.cs} | 2 +- ...erTest.SnapshotGeneratedSource.verified.cs | 27 --------- ...erTest.SnapshotGeneratedSource.verified.cs | 18 ------ ...nShouldTranslateToQuery_query.verified.sql | 3 - ...RunExtensionMappingShouldWork.verified.txt | 2 +- ...sionMappingShouldWork_NET6_0.verified.txt} | 2 +- ...sionMappingShouldWork_NET7_0.verified.txt} | 2 +- ...pperTest.RunMappingShouldWork.verified.txt | 2 +- ....RunMappingShouldWork_NET6_0.verified.txt} | 2 +- ....RunMappingShouldWork_NET7_0.verified.txt} | 2 +- ...erTest.SnapshotGeneratedSource.verified.cs | 2 +- ...napshotGeneratedSource_NET6_0.verified.cs} | 2 +- ...napshotGeneratedSource_NET7_0.verified.cs} | 2 +- ...getNullableShouldWork#Mapper.g.verified.cs | 2 +- ...uldUpgradeNullability#Mapper.g.verified.cs | 2 +- ...uldUpgradeNullability#Mapper.g.verified.cs | 2 +- ...uldUpgradeNullability#Mapper.g.verified.cs | 2 +- ...ContextInSelectClause#Mapper.g.verified.cs | 2 +- ...CarFeature.Mappers.CarMapper.g.verified.cs | 2 +- ...CarFeature.Mappers.CarMapper.g.verified.cs | 2 +- ...CarFeature.Mappers.CarMapper.g.verified.cs | 2 +- ...pacesShouldWork#FooBarMapper.g.verified.cs | 2 +- ...acesShouldWork#FooBarMapper1.g.verified.cs | 2 +- ....ReadOnlyMemoryToList#Mapper.g.verified.cs | 2 +- ...ReadOnlyMemoryToStack#Mapper.g.verified.cs | 2 +- ...ntextInNestedProperty#Mapper.g.verified.cs | 2 +- ...dThrowShouldBeIgnored#Mapper.g.verified.cs | 4 +- ...est.SpanToICollection#Mapper.g.verified.cs | 2 +- .../SpanTest.SpanToIList#Mapper.g.verified.cs | 2 +- ...aseTypeShouldWork#BaseMapper.g.verified.cs | 2 +- ...sBaseTypeShouldWork#MyMapper.g.verified.cs | 2 +- ...efinedStaticMethods#MyMapper.g.verified.cs | 2 +- ...cExistingTargetMethod#Mapper.g.verified.cs | 2 +- ...tanceDisabledNullable#Mapper.g.verified.cs | 2 +- ...ModifiersToMapper#BaseMapper.g.verified.cs | 2 +- ...apFieldAndNestedTuple#Mapper.g.verified.cs | 2 +- ...ldMapNamedNestedTuple#Mapper.g.verified.cs | 2 +- ...CreateSeparateMethods#Mapper.g.verified.cs | 2 +- ...opertyToTupleProperty#Mapper.g.verified.cs | 2 +- 73 files changed, 194 insertions(+), 158 deletions(-) create mode 100644 .gitattributes create mode 100644 test/Riok.Mapperly.IntegrationTests/Helpers/VersionedSnapshotAttribute.cs create mode 100644 test/Riok.Mapperly.IntegrationTests/Helpers/Versions.cs rename test/Riok.Mapperly.IntegrationTests/_snapshots/{Roslyn_4_5 => }/CircularReferenceMapperTest.SnapshotGeneratedSource.verified.cs (100%) rename test/Riok.Mapperly.IntegrationTests/_snapshots/{NET_48 => }/DeepCloningMapperTest.RunMappingShouldWork.verified.txt (99%) rename test/Riok.Mapperly.IntegrationTests/_snapshots/{Roslyn_4_5/DeepCloningMapperTest.RunMappingShouldWork.verified.txt => DeepCloningMapperTest.RunMappingShouldWork_NET6_0.verified.txt} (99%) rename test/Riok.Mapperly.IntegrationTests/_snapshots/{Roslyn_4_4_OR_LOWER/DeepCloningMapperTest.RunMappingShouldWork.verified.txt => DeepCloningMapperTest.RunMappingShouldWork_NET7_0.verified.txt} (99%) rename test/Riok.Mapperly.IntegrationTests/_snapshots/{NET_48 => }/DeepCloningMapperTest.SnapshotGeneratedSource.verified.cs (100%) rename test/Riok.Mapperly.IntegrationTests/_snapshots/{Roslyn_4_4_OR_LOWER/DeepCloningMapperTest.SnapshotGeneratedSource.verified.cs => DeepCloningMapperTest.SnapshotGeneratedSource_NET6_0.verified.cs} (100%) rename test/Riok.Mapperly.IntegrationTests/_snapshots/{Roslyn_4_5/DeepCloningMapperTest.SnapshotGeneratedSource.verified.cs => DeepCloningMapperTest.SnapshotGeneratedSource_NET7_0.verified.cs} (99%) rename test/Riok.Mapperly.IntegrationTests/_snapshots/{NET_48 => }/MapperTest.RunMappingShouldWork.verified.txt (99%) rename test/Riok.Mapperly.IntegrationTests/_snapshots/{Roslyn_4_5/MapperTest.RunMappingShouldWork.verified.txt => MapperTest.RunMappingShouldWork_NET6_0.verified.txt} (99%) rename test/Riok.Mapperly.IntegrationTests/_snapshots/{Roslyn_4_4_OR_LOWER/MapperTest.RunMappingShouldWork.verified.txt => MapperTest.RunMappingShouldWork_NET7_0.verified.txt} (99%) rename test/Riok.Mapperly.IntegrationTests/_snapshots/{NET_48 => }/MapperTest.SnapshotGeneratedSource.verified.cs (100%) rename test/Riok.Mapperly.IntegrationTests/_snapshots/{Roslyn_4_4_OR_LOWER/MapperTest.SnapshotGeneratedSource.verified.cs => MapperTest.SnapshotGeneratedSource_NET6_0.verified.cs} (99%) rename test/Riok.Mapperly.IntegrationTests/_snapshots/{Roslyn_4_5/MapperTest.SnapshotGeneratedSource.verified.cs => MapperTest.SnapshotGeneratedSource_NET7_0.verified.cs} (100%) delete mode 100644 test/Riok.Mapperly.IntegrationTests/_snapshots/NET_48/CircularReferenceMapperTest.SnapshotGeneratedSource.verified.cs delete mode 100644 test/Riok.Mapperly.IntegrationTests/_snapshots/NET_48/NestedMapperTest.SnapshotGeneratedSource.verified.cs rename test/Riok.Mapperly.IntegrationTests/_snapshots/{Roslyn_4_5 => }/NestedMapperTest.SnapshotGeneratedSource.verified.cs (100%) create mode 100644 test/Riok.Mapperly.IntegrationTests/_snapshots/ProjectionMapperTest.DerivedTypesProjectionShouldTranslateToQuery.verified.sql rename test/Riok.Mapperly.IntegrationTests/_snapshots/{Roslyn_4_5/ProjectionMapperTest.DerivedTypesProjectionShouldTranslateToQuery_result.verified.txt => ProjectionMapperTest.DerivedTypesProjectionShouldTranslateToResult.verified.txt} (100%) rename test/Riok.Mapperly.IntegrationTests/_snapshots/{Roslyn_4_5/ProjectionMapperTest.ProjectionShouldTranslateToQuery_query.verified.sql => ProjectionMapperTest.ProjectionShouldTranslateToQuery.verified.sql} (100%) rename test/Riok.Mapperly.IntegrationTests/_snapshots/{Roslyn_4_5/ProjectionMapperTest.ProjectionShouldTranslateToQuery_result.verified.txt => ProjectionMapperTest.ProjectionShouldTranslateToResult.verified.txt} (100%) rename test/Riok.Mapperly.IntegrationTests/_snapshots/{NET_48 => }/ProjectionMapperTest.SnapshotGeneratedSource.verified.cs (99%) rename test/Riok.Mapperly.IntegrationTests/_snapshots/{Roslyn_4_4_OR_LOWER/ProjectionMapperTest.SnapshotGeneratedSource.verified.cs => ProjectionMapperTest.SnapshotGeneratedSource_NET6_0.verified.cs} (100%) rename test/Riok.Mapperly.IntegrationTests/_snapshots/{Roslyn_4_5/ProjectionMapperTest.SnapshotGeneratedSource.verified.cs => ProjectionMapperTest.SnapshotGeneratedSource_NET7_0.verified.cs} (99%) delete mode 100644 test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_4_OR_LOWER/CircularReferenceMapperTest.SnapshotGeneratedSource.verified.cs delete mode 100644 test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_4_OR_LOWER/NestedMapperTest.SnapshotGeneratedSource.verified.cs delete mode 100644 test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/ProjectionMapperTest.DerivedTypesProjectionShouldTranslateToQuery_query.verified.sql rename test/Riok.Mapperly.IntegrationTests/_snapshots/{NET_48 => }/StaticMapperTest.RunExtensionMappingShouldWork.verified.txt (99%) rename test/Riok.Mapperly.IntegrationTests/_snapshots/{Roslyn_4_5/StaticMapperTest.RunExtensionMappingShouldWork.verified.txt => StaticMapperTest.RunExtensionMappingShouldWork_NET6_0.verified.txt} (99%) rename test/Riok.Mapperly.IntegrationTests/_snapshots/{Roslyn_4_4_OR_LOWER/StaticMapperTest.RunExtensionMappingShouldWork.verified.txt => StaticMapperTest.RunExtensionMappingShouldWork_NET7_0.verified.txt} (99%) rename test/Riok.Mapperly.IntegrationTests/_snapshots/{NET_48 => }/StaticMapperTest.RunMappingShouldWork.verified.txt (99%) rename test/Riok.Mapperly.IntegrationTests/_snapshots/{Roslyn_4_5/StaticMapperTest.RunMappingShouldWork.verified.txt => StaticMapperTest.RunMappingShouldWork_NET6_0.verified.txt} (99%) rename test/Riok.Mapperly.IntegrationTests/_snapshots/{Roslyn_4_4_OR_LOWER/StaticMapperTest.RunMappingShouldWork.verified.txt => StaticMapperTest.RunMappingShouldWork_NET7_0.verified.txt} (99%) rename test/Riok.Mapperly.IntegrationTests/_snapshots/{NET_48 => }/StaticMapperTest.SnapshotGeneratedSource.verified.cs (99%) rename test/Riok.Mapperly.IntegrationTests/_snapshots/{Roslyn_4_4_OR_LOWER/StaticMapperTest.SnapshotGeneratedSource.verified.cs => StaticMapperTest.SnapshotGeneratedSource_NET6_0.verified.cs} (99%) rename test/Riok.Mapperly.IntegrationTests/_snapshots/{Roslyn_4_5/StaticMapperTest.SnapshotGeneratedSource.verified.cs => StaticMapperTest.SnapshotGeneratedSource_NET7_0.verified.cs} (99%) diff --git a/.editorconfig b/.editorconfig index bbb9b2bc48..34891e31e9 100644 --- a/.editorconfig +++ b/.editorconfig @@ -11,6 +11,7 @@ insert_final_newline = true indent_style = space indent_size = 4 trim_trailing_whitespace = true +charset = utf-8 # Generated code [*{_AssemblyInfo.cs,.notsupported.cs,AsmOffsets.cs}] @@ -210,3 +211,12 @@ indent_size = 2 # markdown [*.{md,mdx}] indent_size = unset + +# Verify settings +[*.{received,verified}.*] +end_of_line = lf +indent_size = unset +indent_style = unset +insert_final_newline = false +tab_width = unset +trim_trailing_whitespace = false diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..4d368c987d --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +*.verified.txt text eol=lf working-tree-encoding=UTF-8 +*.verified.json text eol=lf working-tree-encoding=UTF-8 +*.verified.cs text eol=lf working-tree-encoding=UTF-8 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 040dbc96b0..ef72ea9239 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -86,6 +86,7 @@ jobs: - uses: actions/setup-dotnet@v3.2.0 with: dotnet-version: ${{ matrix.dotnet }} + - run: dotnet --list-sdks - uses: actions/download-artifact@v3 with: name: mapperly-nupkg @@ -113,6 +114,7 @@ jobs: - uses: actions/checkout@v3 # delete global.json since we want to use custom versions here - run: rm global.json + - run: dotnet --list-sdks - uses: actions/download-artifact@v3 with: name: mapperly-nupkg diff --git a/docs/docs/contributing/common-tasks.md b/docs/docs/contributing/common-tasks.md index 5a7a16d770..9967dc4450 100644 --- a/docs/docs/contributing/common-tasks.md +++ b/docs/docs/contributing/common-tasks.md @@ -36,13 +36,14 @@ To support a new roslyn version via multi targeting follow these steps (see also 2. Create a new file `Riok.Mapperly.Roslyn$(Version).props` in `src/Riok.Mapperly` similar to the existing ones and define constants and include dependencies as needed. 3. Update the default `ROSLYN_VERSION` in `src/Riok.Mapperly/Riok.Mapperly.csproj`. -4. Update the `Microsoft.CodeAnalysis.CSharp` dependency version in `test/Riok.Mapperly.Tests/Riok.Mapperly.Tests.csproj`. +4. Update the `Microsoft.CodeAnalysis.CSharp` dependency version. 5. Adjust the .NET version matrix of the `integration-test` GitHub Actions job (defined in `.github/workflows/test.yml`) to include a dotnet version which is based on the added Roslyn version. 6. Adjust the .NET version in the `global.json` file as needed. -7. If generated code changes based on the new Roslyn version, - introduce a new `roslynVersionName` in `Riok.Mapperly.IntegrationTests.BaseMapperTest.GetRoslynVersion()` and generate the new snapshots. -8. Adjust the documentation as needed. +7. Add the new version in `Riok.Mapperly.IntegrationTests.Helpers.Versions` and `Riok.Mapperly.IntegrationTests.BaseMapperTest.GetCurrentVersion`. +8. If generated code changes based on the new Roslyn version, + adjust the `VersionedSnapshotAttribute`s as needed. +9. Adjust the documentation as needed. ## Mapping syntax diff --git a/docs/docs/contributing/tests.md b/docs/docs/contributing/tests.md index f030428b27..51d868a109 100644 --- a/docs/docs/contributing/tests.md +++ b/docs/docs/contributing/tests.md @@ -36,7 +36,15 @@ These tests run locally by referencing the source generator as an analyzer. In the CI pipeline, the integration tests reference the built NuGet package and are run on several supported target frameworks (including .NET 7.0 but also .NET Framework). -Snapshots of the generated code are stored per Roslyn version. +If the content of the snapshot is different depending on the target framework used, +`[VersionedSnapshot(...)]` can be applied on a test class or method. +The version of each version, +which produces a changed snapshot content should be passed to the `VersionedSnapshotAttribute`. +Eg. +if a snapshots content is different for .NET 6.0, .NET 7.0 and .NET Framework 4.8 but .NET 8.0 is the same as .NET 7.0, +`[VersionedSnapshot(Versions.NET6_0 | Versions.NET7_0)]` can be applied. +The resulting snapshot is then stored three times: +in `default` for .NET Framework 4.8, in `NET6_0` for .NET 6.0 and in `NET7_0` for .NET 7.0 and later. You may need to manually update older versions. The received snapshots of the tests are saved in the GitHub Actions as artifacts and can be downloaded. diff --git a/test/Riok.Mapperly.IntegrationTests/BaseMapperTest.cs b/test/Riok.Mapperly.IntegrationTests/BaseMapperTest.cs index 50e285afe6..80f901e797 100644 --- a/test/Riok.Mapperly.IntegrationTests/BaseMapperTest.cs +++ b/test/Riok.Mapperly.IntegrationTests/BaseMapperTest.cs @@ -2,8 +2,11 @@ using System.Collections.Generic; using System.Collections.Immutable; using System.IO; +using System.Linq; +using System.Reflection; using System.Runtime.CompilerServices; using Riok.Mapperly.IntegrationTests.Dto; +using Riok.Mapperly.IntegrationTests.Helpers; using Riok.Mapperly.IntegrationTests.Models; using VerifyTests; using VerifyXunit; @@ -30,7 +33,11 @@ static BaseMapperTest() Verifier.DerivePathInfo( (file, _, type, method) => - new PathInfo(Path.Combine(Path.GetDirectoryName(file)!, "_snapshots", GetPlatformVersion()), type.Name, method.Name) + new PathInfo( + Path.Combine(Path.GetDirectoryName(file)!, "_snapshots"), + type.Name, + method.Name + GetSnapshotVersionSuffix(type, method) + ) ); } @@ -120,14 +127,50 @@ public static TestObject NewTestObj() }; } - private static string GetPlatformVersion() + /// + /// Gets the version of the snapshot. + /// If the test is not a , empty string is returned. + /// Otherwise either the current version, or the latest version of the prefixed with a _ is returned. + /// + /// The type of the test method. + /// The test method. + /// Either an empty string or the name of the version. + private static string GetSnapshotVersionSuffix(Type type, MethodInfo method) + { + var versionedSnapshot = + method.GetCustomAttribute() ?? type.GetCustomAttribute(); + if (versionedSnapshot == null) + return string.Empty; + + var currentVersion = GetCurrentVersion(); + if (versionedSnapshot.VersionsWithChanges.HasFlag(currentVersion)) + return "_" + currentVersion; + + var supportedVersions = Enum.GetValues(typeof(Versions)) + .Cast() + .Where(x => x < currentVersion) + .OrderByDescending(x => x); + foreach (var supportedVersion in supportedVersions) + { + if (versionedSnapshot.VersionsWithChanges.HasFlag(supportedVersion)) + return "_" + supportedVersion; + } + + return string.Empty; + } + + private static Versions GetCurrentVersion() { -#if NET48_OR_GREATER - return "NET_48"; +#if NET8_0_OR_GREATER + return Versions.NET8_0; #elif NET7_0_OR_GREATER - return "Roslyn_4_5"; + return Versions.NET7_0; +#elif NET6_0_OR_GREATER + return Versions.NET6_0; +#elif NET48_OR_GREATER + return Versions.NETFRAMEWORK4_8; #else - return "Roslyn_4_4_OR_LOWER"; + throw new InvalidOperationException("Target framework is not supported"); #endif } } diff --git a/test/Riok.Mapperly.IntegrationTests/DeepCloningMapperTest.cs b/test/Riok.Mapperly.IntegrationTests/DeepCloningMapperTest.cs index 32132a02df..ea5c7ab8c0 100644 --- a/test/Riok.Mapperly.IntegrationTests/DeepCloningMapperTest.cs +++ b/test/Riok.Mapperly.IntegrationTests/DeepCloningMapperTest.cs @@ -1,5 +1,6 @@ using System.Threading.Tasks; using FluentAssertions; +using Riok.Mapperly.IntegrationTests.Helpers; using Riok.Mapperly.IntegrationTests.Mapper; using Riok.Mapperly.IntegrationTests.Models; using VerifyXunit; @@ -11,6 +12,7 @@ namespace Riok.Mapperly.IntegrationTests public class DeepCloningMapperTest : BaseMapperTest { [Fact] + [VersionedSnapshot(Versions.NET6_0 | Versions.NET7_0)] public Task SnapshotGeneratedSource() { var path = GetGeneratedMapperFilePath(nameof(DeepCloningMapper)); @@ -18,6 +20,7 @@ public Task SnapshotGeneratedSource() } [Fact] + [VersionedSnapshot(Versions.NET6_0 | Versions.NET7_0)] public Task RunMappingShouldWork() { var model = NewTestObj(); diff --git a/test/Riok.Mapperly.IntegrationTests/Helpers/VersionedSnapshotAttribute.cs b/test/Riok.Mapperly.IntegrationTests/Helpers/VersionedSnapshotAttribute.cs new file mode 100644 index 0000000000..defced7244 --- /dev/null +++ b/test/Riok.Mapperly.IntegrationTests/Helpers/VersionedSnapshotAttribute.cs @@ -0,0 +1,22 @@ +using System; + +namespace Riok.Mapperly.IntegrationTests.Helpers +{ + /// + /// Uses different paths for snapshots of each version with expected changes. + /// + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)] + public class VersionedSnapshotAttribute : Attribute + { + /// + /// Uses different paths for snapshots of each version with expected changes. + /// + /// The versions which result in different snapshot content than the previous version. + public VersionedSnapshotAttribute(Versions versionsWithChanges) + { + VersionsWithChanges = versionsWithChanges; + } + + public Versions VersionsWithChanges { get; } + } +} diff --git a/test/Riok.Mapperly.IntegrationTests/Helpers/Versions.cs b/test/Riok.Mapperly.IntegrationTests/Helpers/Versions.cs new file mode 100644 index 0000000000..407c80083b --- /dev/null +++ b/test/Riok.Mapperly.IntegrationTests/Helpers/Versions.cs @@ -0,0 +1,12 @@ +using System; + +namespace Riok.Mapperly.IntegrationTests.Helpers +{ + [Flags] + public enum Versions + { + NETFRAMEWORK4_8 = 1 << 0, + NET6_0 = 1 << 1, + NET7_0 = 1 << 2, + } +} diff --git a/test/Riok.Mapperly.IntegrationTests/MapperTest.cs b/test/Riok.Mapperly.IntegrationTests/MapperTest.cs index 0bbe242b81..326afc130e 100644 --- a/test/Riok.Mapperly.IntegrationTests/MapperTest.cs +++ b/test/Riok.Mapperly.IntegrationTests/MapperTest.cs @@ -1,4 +1,5 @@ using System.Threading.Tasks; +using Riok.Mapperly.IntegrationTests.Helpers; using Riok.Mapperly.IntegrationTests.Mapper; using VerifyXunit; using Xunit; @@ -6,6 +7,7 @@ namespace Riok.Mapperly.IntegrationTests { [UsesVerify] + [VersionedSnapshot(Versions.NET6_0 | Versions.NET7_0)] public class MapperTest : BaseMapperTest { [Fact] diff --git a/test/Riok.Mapperly.IntegrationTests/ProjectionMapperTest.cs b/test/Riok.Mapperly.IntegrationTests/ProjectionMapperTest.cs index 5d3d8e9e3f..9e586b0dc9 100644 --- a/test/Riok.Mapperly.IntegrationTests/ProjectionMapperTest.cs +++ b/test/Riok.Mapperly.IntegrationTests/ProjectionMapperTest.cs @@ -1,6 +1,7 @@ using System; using System.Linq; using System.Threading.Tasks; +using Riok.Mapperly.IntegrationTests.Helpers; using Riok.Mapperly.IntegrationTests.Mapper; using Riok.Mapperly.IntegrationTests.Models; using VerifyXunit; @@ -16,6 +17,7 @@ namespace Riok.Mapperly.IntegrationTests public class ProjectionMapperTest : BaseMapperTest { [Fact] + [VersionedSnapshot(Versions.NET6_0 | Versions.NET7_0)] public Task SnapshotGeneratedSource() { var path = GetGeneratedMapperFilePath(nameof(ProjectionMapper)); @@ -26,26 +28,40 @@ public Task SnapshotGeneratedSource() [Fact] public Task ProjectionShouldTranslateToQuery() { - return RunWithDatabase(async ctx => + return RunWithDatabase(ctx => { var query = ctx.Objects.ProjectToDto(); - await Verifier.Verify(query.ToQueryString(), "sql").UseTextForParameters("query"); + return Verifier.Verify(query.ToQueryString(), "sql"); + }); + } - var objects = await query.ToListAsync(); - await Verifier.Verify(objects).UseTextForParameters("result"); + [Fact] + public Task ProjectionShouldTranslateToResult() + { + return RunWithDatabase(async ctx => + { + var objects = await ctx.Objects.ProjectToDto().ToListAsync(); + await Verifier.Verify(objects); }); } [Fact] public Task DerivedTypesProjectionShouldTranslateToQuery() { - return RunWithDatabase(async ctx => + return RunWithDatabase(ctx => { var query = ctx.BaseTypeObjects.OrderBy(x => x.BaseValue).ProjectToDto(); - await Verifier.Verify(query.ToQueryString(), "sql").UseTextForParameters("query"); + return Verifier.Verify(query.ToQueryString(), "sql"); + }); + } - var objects = await query.ToListAsync(); - await Verifier.Verify(objects).UseTextForParameters("result"); + [Fact] + public Task DerivedTypesProjectionShouldTranslateToResult() + { + return RunWithDatabase(async ctx => + { + var objects = await ctx.BaseTypeObjects.OrderBy(x => x.BaseValue).ProjectToDto().ToListAsync(); + await Verifier.Verify(objects); }); } diff --git a/test/Riok.Mapperly.IntegrationTests/StaticMapperTest.cs b/test/Riok.Mapperly.IntegrationTests/StaticMapperTest.cs index c4b6045ceb..a7f886bc67 100644 --- a/test/Riok.Mapperly.IntegrationTests/StaticMapperTest.cs +++ b/test/Riok.Mapperly.IntegrationTests/StaticMapperTest.cs @@ -1,6 +1,7 @@ using System.Threading.Tasks; using FluentAssertions; using Riok.Mapperly.IntegrationTests.Dto; +using Riok.Mapperly.IntegrationTests.Helpers; using Riok.Mapperly.IntegrationTests.Mapper; using Riok.Mapperly.IntegrationTests.Models; using VerifyXunit; @@ -12,6 +13,7 @@ namespace Riok.Mapperly.IntegrationTests public class StaticMapperTest : BaseMapperTest { [Fact] + [VersionedSnapshot(Versions.NET6_0 | Versions.NET7_0)] public Task SnapshotGeneratedSource() { var path = GetGeneratedMapperFilePath(nameof(StaticTestMapper)); @@ -19,6 +21,7 @@ public Task SnapshotGeneratedSource() } [Fact] + [VersionedSnapshot(Versions.NET6_0 | Versions.NET7_0)] public Task RunMappingShouldWork() { var model = NewTestObj(); @@ -27,6 +30,7 @@ public Task RunMappingShouldWork() } [Fact] + [VersionedSnapshot(Versions.NET6_0 | Versions.NET7_0)] public Task RunExtensionMappingShouldWork() { var model = NewTestObj(); diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/CircularReferenceMapperTest.SnapshotGeneratedSource.verified.cs b/test/Riok.Mapperly.IntegrationTests/_snapshots/CircularReferenceMapperTest.SnapshotGeneratedSource.verified.cs similarity index 100% rename from test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/CircularReferenceMapperTest.SnapshotGeneratedSource.verified.cs rename to test/Riok.Mapperly.IntegrationTests/_snapshots/CircularReferenceMapperTest.SnapshotGeneratedSource.verified.cs diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/NET_48/DeepCloningMapperTest.RunMappingShouldWork.verified.txt b/test/Riok.Mapperly.IntegrationTests/_snapshots/DeepCloningMapperTest.RunMappingShouldWork.verified.txt similarity index 99% rename from test/Riok.Mapperly.IntegrationTests/_snapshots/NET_48/DeepCloningMapperTest.RunMappingShouldWork.verified.txt rename to test/Riok.Mapperly.IntegrationTests/_snapshots/DeepCloningMapperTest.RunMappingShouldWork.verified.txt index 64c8ef0c0e..a9046f7811 100644 --- a/test/Riok.Mapperly.IntegrationTests/_snapshots/NET_48/DeepCloningMapperTest.RunMappingShouldWork.verified.txt +++ b/test/Riok.Mapperly.IntegrationTests/_snapshots/DeepCloningMapperTest.RunMappingShouldWork.verified.txt @@ -160,4 +160,4 @@ }, DateTimeValueTargetDateOnly: 2020-01-03 15:10:05 Utc, DateTimeValueTargetTimeOnly: 2020-01-03 15:10:05 Utc -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/DeepCloningMapperTest.RunMappingShouldWork.verified.txt b/test/Riok.Mapperly.IntegrationTests/_snapshots/DeepCloningMapperTest.RunMappingShouldWork_NET6_0.verified.txt similarity index 99% rename from test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/DeepCloningMapperTest.RunMappingShouldWork.verified.txt rename to test/Riok.Mapperly.IntegrationTests/_snapshots/DeepCloningMapperTest.RunMappingShouldWork_NET6_0.verified.txt index 56481798b4..97299a4121 100644 --- a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/DeepCloningMapperTest.RunMappingShouldWork.verified.txt +++ b/test/Riok.Mapperly.IntegrationTests/_snapshots/DeepCloningMapperTest.RunMappingShouldWork_NET6_0.verified.txt @@ -165,4 +165,4 @@ }, DateTimeValueTargetDateOnly: 2020-01-03 15:10:05 Utc, DateTimeValueTargetTimeOnly: 2020-01-03 15:10:05 Utc -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_4_OR_LOWER/DeepCloningMapperTest.RunMappingShouldWork.verified.txt b/test/Riok.Mapperly.IntegrationTests/_snapshots/DeepCloningMapperTest.RunMappingShouldWork_NET7_0.verified.txt similarity index 99% rename from test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_4_OR_LOWER/DeepCloningMapperTest.RunMappingShouldWork.verified.txt rename to test/Riok.Mapperly.IntegrationTests/_snapshots/DeepCloningMapperTest.RunMappingShouldWork_NET7_0.verified.txt index 56481798b4..97299a4121 100644 --- a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_4_OR_LOWER/DeepCloningMapperTest.RunMappingShouldWork.verified.txt +++ b/test/Riok.Mapperly.IntegrationTests/_snapshots/DeepCloningMapperTest.RunMappingShouldWork_NET7_0.verified.txt @@ -165,4 +165,4 @@ }, DateTimeValueTargetDateOnly: 2020-01-03 15:10:05 Utc, DateTimeValueTargetTimeOnly: 2020-01-03 15:10:05 Utc -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/NET_48/DeepCloningMapperTest.SnapshotGeneratedSource.verified.cs b/test/Riok.Mapperly.IntegrationTests/_snapshots/DeepCloningMapperTest.SnapshotGeneratedSource.verified.cs similarity index 100% rename from test/Riok.Mapperly.IntegrationTests/_snapshots/NET_48/DeepCloningMapperTest.SnapshotGeneratedSource.verified.cs rename to test/Riok.Mapperly.IntegrationTests/_snapshots/DeepCloningMapperTest.SnapshotGeneratedSource.verified.cs diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_4_OR_LOWER/DeepCloningMapperTest.SnapshotGeneratedSource.verified.cs b/test/Riok.Mapperly.IntegrationTests/_snapshots/DeepCloningMapperTest.SnapshotGeneratedSource_NET6_0.verified.cs similarity index 100% rename from test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_4_OR_LOWER/DeepCloningMapperTest.SnapshotGeneratedSource.verified.cs rename to test/Riok.Mapperly.IntegrationTests/_snapshots/DeepCloningMapperTest.SnapshotGeneratedSource_NET6_0.verified.cs diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/DeepCloningMapperTest.SnapshotGeneratedSource.verified.cs b/test/Riok.Mapperly.IntegrationTests/_snapshots/DeepCloningMapperTest.SnapshotGeneratedSource_NET7_0.verified.cs similarity index 99% rename from test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/DeepCloningMapperTest.SnapshotGeneratedSource.verified.cs rename to test/Riok.Mapperly.IntegrationTests/_snapshots/DeepCloningMapperTest.SnapshotGeneratedSource_NET7_0.verified.cs index bb8c6f6914..b57ff290f6 100644 --- a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/DeepCloningMapperTest.SnapshotGeneratedSource.verified.cs +++ b/test/Riok.Mapperly.IntegrationTests/_snapshots/DeepCloningMapperTest.SnapshotGeneratedSource_NET7_0.verified.cs @@ -146,4 +146,4 @@ private static (string A, string) MapToValueTuple((string A, string) source) return target; } } -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/NET_48/MapperTest.RunMappingShouldWork.verified.txt b/test/Riok.Mapperly.IntegrationTests/_snapshots/MapperTest.RunMappingShouldWork.verified.txt similarity index 99% rename from test/Riok.Mapperly.IntegrationTests/_snapshots/NET_48/MapperTest.RunMappingShouldWork.verified.txt rename to test/Riok.Mapperly.IntegrationTests/_snapshots/MapperTest.RunMappingShouldWork.verified.txt index 377d513745..140a1fe5e4 100644 --- a/test/Riok.Mapperly.IntegrationTests/_snapshots/NET_48/MapperTest.RunMappingShouldWork.verified.txt +++ b/test/Riok.Mapperly.IntegrationTests/_snapshots/MapperTest.RunMappingShouldWork.verified.txt @@ -176,4 +176,4 @@ }, DateTimeValueTargetDateOnly: 2020-01-03, DateTimeValueTargetTimeOnly: 3:10 PM -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/MapperTest.RunMappingShouldWork.verified.txt b/test/Riok.Mapperly.IntegrationTests/_snapshots/MapperTest.RunMappingShouldWork_NET6_0.verified.txt similarity index 99% rename from test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/MapperTest.RunMappingShouldWork.verified.txt rename to test/Riok.Mapperly.IntegrationTests/_snapshots/MapperTest.RunMappingShouldWork_NET6_0.verified.txt index 6b5f6eda63..128e6b3084 100644 --- a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/MapperTest.RunMappingShouldWork.verified.txt +++ b/test/Riok.Mapperly.IntegrationTests/_snapshots/MapperTest.RunMappingShouldWork_NET6_0.verified.txt @@ -181,4 +181,4 @@ }, DateTimeValueTargetDateOnly: 2020-01-03, DateTimeValueTargetTimeOnly: 3:10 PM -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_4_OR_LOWER/MapperTest.RunMappingShouldWork.verified.txt b/test/Riok.Mapperly.IntegrationTests/_snapshots/MapperTest.RunMappingShouldWork_NET7_0.verified.txt similarity index 99% rename from test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_4_OR_LOWER/MapperTest.RunMappingShouldWork.verified.txt rename to test/Riok.Mapperly.IntegrationTests/_snapshots/MapperTest.RunMappingShouldWork_NET7_0.verified.txt index 6b5f6eda63..128e6b3084 100644 --- a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_4_OR_LOWER/MapperTest.RunMappingShouldWork.verified.txt +++ b/test/Riok.Mapperly.IntegrationTests/_snapshots/MapperTest.RunMappingShouldWork_NET7_0.verified.txt @@ -181,4 +181,4 @@ }, DateTimeValueTargetDateOnly: 2020-01-03, DateTimeValueTargetTimeOnly: 3:10 PM -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/NET_48/MapperTest.SnapshotGeneratedSource.verified.cs b/test/Riok.Mapperly.IntegrationTests/_snapshots/MapperTest.SnapshotGeneratedSource.verified.cs similarity index 100% rename from test/Riok.Mapperly.IntegrationTests/_snapshots/NET_48/MapperTest.SnapshotGeneratedSource.verified.cs rename to test/Riok.Mapperly.IntegrationTests/_snapshots/MapperTest.SnapshotGeneratedSource.verified.cs diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_4_OR_LOWER/MapperTest.SnapshotGeneratedSource.verified.cs b/test/Riok.Mapperly.IntegrationTests/_snapshots/MapperTest.SnapshotGeneratedSource_NET6_0.verified.cs similarity index 99% rename from test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_4_OR_LOWER/MapperTest.SnapshotGeneratedSource.verified.cs rename to test/Riok.Mapperly.IntegrationTests/_snapshots/MapperTest.SnapshotGeneratedSource_NET6_0.verified.cs index 41884de2b3..e391c171ed 100644 --- a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_4_OR_LOWER/MapperTest.SnapshotGeneratedSource.verified.cs +++ b/test/Riok.Mapperly.IntegrationTests/_snapshots/MapperTest.SnapshotGeneratedSource_NET6_0.verified.cs @@ -492,4 +492,4 @@ private string MapToString1(global::Riok.Mapperly.IntegrationTests.Dto.TestEnumD return target; } } -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/MapperTest.SnapshotGeneratedSource.verified.cs b/test/Riok.Mapperly.IntegrationTests/_snapshots/MapperTest.SnapshotGeneratedSource_NET7_0.verified.cs similarity index 100% rename from test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/MapperTest.SnapshotGeneratedSource.verified.cs rename to test/Riok.Mapperly.IntegrationTests/_snapshots/MapperTest.SnapshotGeneratedSource_NET7_0.verified.cs diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/NET_48/CircularReferenceMapperTest.SnapshotGeneratedSource.verified.cs b/test/Riok.Mapperly.IntegrationTests/_snapshots/NET_48/CircularReferenceMapperTest.SnapshotGeneratedSource.verified.cs deleted file mode 100644 index ef273f7f0d..0000000000 --- a/test/Riok.Mapperly.IntegrationTests/_snapshots/NET_48/CircularReferenceMapperTest.SnapshotGeneratedSource.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -// -#nullable enable -namespace Riok.Mapperly.IntegrationTests.Mapper -{ - public static partial class CircularReferenceMapper - { - public static partial global::Riok.Mapperly.IntegrationTests.Dto.CircularReferenceDto ToDto(global::Riok.Mapperly.IntegrationTests.Models.CircularReferenceObject obj) - { - return MapToCircularReferenceDto(obj, new global::Riok.Mapperly.Abstractions.ReferenceHandling.Internal.PreserveReferenceHandler()); - } - - private static global::Riok.Mapperly.IntegrationTests.Dto.CircularReferenceDto MapToCircularReferenceDto(global::Riok.Mapperly.IntegrationTests.Models.CircularReferenceObject source, global::Riok.Mapperly.Abstractions.ReferenceHandling.IReferenceHandler refHandler) - { - if (refHandler.TryGetReference(source, out var existingTargetReference)) - return existingTargetReference; - var target = new global::Riok.Mapperly.IntegrationTests.Dto.CircularReferenceDto(); - refHandler.SetReference(source, target); - if (source.Parent != null) - { - target.Parent = MapToCircularReferenceDto(source.Parent, refHandler); - } - - target.Value = source.Value; - return target; - } - } -} diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/NET_48/NestedMapperTest.SnapshotGeneratedSource.verified.cs b/test/Riok.Mapperly.IntegrationTests/_snapshots/NET_48/NestedMapperTest.SnapshotGeneratedSource.verified.cs deleted file mode 100644 index bbe33e0073..0000000000 --- a/test/Riok.Mapperly.IntegrationTests/_snapshots/NET_48/NestedMapperTest.SnapshotGeneratedSource.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -// -#nullable enable -namespace Riok.Mapperly.IntegrationTests.Mapper -{ - public static partial class NestedTestMapper - { - public static partial class TestNesting - { - public static partial class NestedMapper - { - public static partial int ToInt(decimal value) - { - return (int)value; - } - } - } - } -} diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/NestedMapperTest.SnapshotGeneratedSource.verified.cs b/test/Riok.Mapperly.IntegrationTests/_snapshots/NestedMapperTest.SnapshotGeneratedSource.verified.cs similarity index 100% rename from test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/NestedMapperTest.SnapshotGeneratedSource.verified.cs rename to test/Riok.Mapperly.IntegrationTests/_snapshots/NestedMapperTest.SnapshotGeneratedSource.verified.cs diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/ProjectionMapperTest.DerivedTypesProjectionShouldTranslateToQuery.verified.sql b/test/Riok.Mapperly.IntegrationTests/_snapshots/ProjectionMapperTest.DerivedTypesProjectionShouldTranslateToQuery.verified.sql new file mode 100644 index 0000000000..e824b41b10 --- /dev/null +++ b/test/Riok.Mapperly.IntegrationTests/_snapshots/ProjectionMapperTest.DerivedTypesProjectionShouldTranslateToQuery.verified.sql @@ -0,0 +1,3 @@ +SELECT "b"."type" = 'A', "b"."ValueA", "b"."Id", "b"."BaseValue", "b"."type" = 'B', "b"."ValueB" +FROM "BaseTypeObjects" AS "b" +ORDER BY "b"."BaseValue" \ No newline at end of file diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/ProjectionMapperTest.DerivedTypesProjectionShouldTranslateToQuery_result.verified.txt b/test/Riok.Mapperly.IntegrationTests/_snapshots/ProjectionMapperTest.DerivedTypesProjectionShouldTranslateToResult.verified.txt similarity index 100% rename from test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/ProjectionMapperTest.DerivedTypesProjectionShouldTranslateToQuery_result.verified.txt rename to test/Riok.Mapperly.IntegrationTests/_snapshots/ProjectionMapperTest.DerivedTypesProjectionShouldTranslateToResult.verified.txt diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/ProjectionMapperTest.ProjectionShouldTranslateToQuery_query.verified.sql b/test/Riok.Mapperly.IntegrationTests/_snapshots/ProjectionMapperTest.ProjectionShouldTranslateToQuery.verified.sql similarity index 100% rename from test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/ProjectionMapperTest.ProjectionShouldTranslateToQuery_query.verified.sql rename to test/Riok.Mapperly.IntegrationTests/_snapshots/ProjectionMapperTest.ProjectionShouldTranslateToQuery.verified.sql diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/ProjectionMapperTest.ProjectionShouldTranslateToQuery_result.verified.txt b/test/Riok.Mapperly.IntegrationTests/_snapshots/ProjectionMapperTest.ProjectionShouldTranslateToResult.verified.txt similarity index 100% rename from test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/ProjectionMapperTest.ProjectionShouldTranslateToQuery_result.verified.txt rename to test/Riok.Mapperly.IntegrationTests/_snapshots/ProjectionMapperTest.ProjectionShouldTranslateToResult.verified.txt diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/NET_48/ProjectionMapperTest.SnapshotGeneratedSource.verified.cs b/test/Riok.Mapperly.IntegrationTests/_snapshots/ProjectionMapperTest.SnapshotGeneratedSource.verified.cs similarity index 99% rename from test/Riok.Mapperly.IntegrationTests/_snapshots/NET_48/ProjectionMapperTest.SnapshotGeneratedSource.verified.cs rename to test/Riok.Mapperly.IntegrationTests/_snapshots/ProjectionMapperTest.SnapshotGeneratedSource.verified.cs index 431debd70c..b7e9836422 100644 --- a/test/Riok.Mapperly.IntegrationTests/_snapshots/NET_48/ProjectionMapperTest.SnapshotGeneratedSource.verified.cs +++ b/test/Riok.Mapperly.IntegrationTests/_snapshots/ProjectionMapperTest.SnapshotGeneratedSource.verified.cs @@ -146,4 +146,4 @@ private static string MapToString(global::Riok.Mapperly.IntegrationTests.Models. return target; } } -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_4_OR_LOWER/ProjectionMapperTest.SnapshotGeneratedSource.verified.cs b/test/Riok.Mapperly.IntegrationTests/_snapshots/ProjectionMapperTest.SnapshotGeneratedSource_NET6_0.verified.cs similarity index 100% rename from test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_4_OR_LOWER/ProjectionMapperTest.SnapshotGeneratedSource.verified.cs rename to test/Riok.Mapperly.IntegrationTests/_snapshots/ProjectionMapperTest.SnapshotGeneratedSource_NET6_0.verified.cs diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/ProjectionMapperTest.SnapshotGeneratedSource.verified.cs b/test/Riok.Mapperly.IntegrationTests/_snapshots/ProjectionMapperTest.SnapshotGeneratedSource_NET7_0.verified.cs similarity index 99% rename from test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/ProjectionMapperTest.SnapshotGeneratedSource.verified.cs rename to test/Riok.Mapperly.IntegrationTests/_snapshots/ProjectionMapperTest.SnapshotGeneratedSource_NET7_0.verified.cs index 15094d8ac8..70f2d178d6 100644 --- a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/ProjectionMapperTest.SnapshotGeneratedSource.verified.cs +++ b/test/Riok.Mapperly.IntegrationTests/_snapshots/ProjectionMapperTest.SnapshotGeneratedSource_NET7_0.verified.cs @@ -146,4 +146,4 @@ private static string MapToString(global::Riok.Mapperly.IntegrationTests.Models. return target; } } -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_4_OR_LOWER/CircularReferenceMapperTest.SnapshotGeneratedSource.verified.cs b/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_4_OR_LOWER/CircularReferenceMapperTest.SnapshotGeneratedSource.verified.cs deleted file mode 100644 index ef273f7f0d..0000000000 --- a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_4_OR_LOWER/CircularReferenceMapperTest.SnapshotGeneratedSource.verified.cs +++ /dev/null @@ -1,27 +0,0 @@ -// -#nullable enable -namespace Riok.Mapperly.IntegrationTests.Mapper -{ - public static partial class CircularReferenceMapper - { - public static partial global::Riok.Mapperly.IntegrationTests.Dto.CircularReferenceDto ToDto(global::Riok.Mapperly.IntegrationTests.Models.CircularReferenceObject obj) - { - return MapToCircularReferenceDto(obj, new global::Riok.Mapperly.Abstractions.ReferenceHandling.Internal.PreserveReferenceHandler()); - } - - private static global::Riok.Mapperly.IntegrationTests.Dto.CircularReferenceDto MapToCircularReferenceDto(global::Riok.Mapperly.IntegrationTests.Models.CircularReferenceObject source, global::Riok.Mapperly.Abstractions.ReferenceHandling.IReferenceHandler refHandler) - { - if (refHandler.TryGetReference(source, out var existingTargetReference)) - return existingTargetReference; - var target = new global::Riok.Mapperly.IntegrationTests.Dto.CircularReferenceDto(); - refHandler.SetReference(source, target); - if (source.Parent != null) - { - target.Parent = MapToCircularReferenceDto(source.Parent, refHandler); - } - - target.Value = source.Value; - return target; - } - } -} diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_4_OR_LOWER/NestedMapperTest.SnapshotGeneratedSource.verified.cs b/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_4_OR_LOWER/NestedMapperTest.SnapshotGeneratedSource.verified.cs deleted file mode 100644 index bbe33e0073..0000000000 --- a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_4_OR_LOWER/NestedMapperTest.SnapshotGeneratedSource.verified.cs +++ /dev/null @@ -1,18 +0,0 @@ -// -#nullable enable -namespace Riok.Mapperly.IntegrationTests.Mapper -{ - public static partial class NestedTestMapper - { - public static partial class TestNesting - { - public static partial class NestedMapper - { - public static partial int ToInt(decimal value) - { - return (int)value; - } - } - } - } -} diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/ProjectionMapperTest.DerivedTypesProjectionShouldTranslateToQuery_query.verified.sql b/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/ProjectionMapperTest.DerivedTypesProjectionShouldTranslateToQuery_query.verified.sql deleted file mode 100644 index 2d158e4e1b..0000000000 --- a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/ProjectionMapperTest.DerivedTypesProjectionShouldTranslateToQuery_query.verified.sql +++ /dev/null @@ -1,3 +0,0 @@ -SELECT "b"."type" = 'A', "b"."ValueA", "b"."Id", "b"."BaseValue", "b"."type" = 'B', "b"."ValueB" -FROM "BaseTypeObjects" AS "b" -ORDER BY "b"."BaseValue" diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/NET_48/StaticMapperTest.RunExtensionMappingShouldWork.verified.txt b/test/Riok.Mapperly.IntegrationTests/_snapshots/StaticMapperTest.RunExtensionMappingShouldWork.verified.txt similarity index 99% rename from test/Riok.Mapperly.IntegrationTests/_snapshots/NET_48/StaticMapperTest.RunExtensionMappingShouldWork.verified.txt rename to test/Riok.Mapperly.IntegrationTests/_snapshots/StaticMapperTest.RunExtensionMappingShouldWork.verified.txt index 461ef9856d..ebc087b139 100644 --- a/test/Riok.Mapperly.IntegrationTests/_snapshots/NET_48/StaticMapperTest.RunExtensionMappingShouldWork.verified.txt +++ b/test/Riok.Mapperly.IntegrationTests/_snapshots/StaticMapperTest.RunExtensionMappingShouldWork.verified.txt @@ -171,4 +171,4 @@ }, DateTimeValueTargetDateOnly: 2020-01-03, DateTimeValueTargetTimeOnly: 3:10 PM -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/StaticMapperTest.RunExtensionMappingShouldWork.verified.txt b/test/Riok.Mapperly.IntegrationTests/_snapshots/StaticMapperTest.RunExtensionMappingShouldWork_NET6_0.verified.txt similarity index 99% rename from test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/StaticMapperTest.RunExtensionMappingShouldWork.verified.txt rename to test/Riok.Mapperly.IntegrationTests/_snapshots/StaticMapperTest.RunExtensionMappingShouldWork_NET6_0.verified.txt index 0ef8572b04..6b3cde8e51 100644 --- a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/StaticMapperTest.RunExtensionMappingShouldWork.verified.txt +++ b/test/Riok.Mapperly.IntegrationTests/_snapshots/StaticMapperTest.RunExtensionMappingShouldWork_NET6_0.verified.txt @@ -176,4 +176,4 @@ }, DateTimeValueTargetDateOnly: 2020-01-03, DateTimeValueTargetTimeOnly: 3:10 PM -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_4_OR_LOWER/StaticMapperTest.RunExtensionMappingShouldWork.verified.txt b/test/Riok.Mapperly.IntegrationTests/_snapshots/StaticMapperTest.RunExtensionMappingShouldWork_NET7_0.verified.txt similarity index 99% rename from test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_4_OR_LOWER/StaticMapperTest.RunExtensionMappingShouldWork.verified.txt rename to test/Riok.Mapperly.IntegrationTests/_snapshots/StaticMapperTest.RunExtensionMappingShouldWork_NET7_0.verified.txt index 0ef8572b04..6b3cde8e51 100644 --- a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_4_OR_LOWER/StaticMapperTest.RunExtensionMappingShouldWork.verified.txt +++ b/test/Riok.Mapperly.IntegrationTests/_snapshots/StaticMapperTest.RunExtensionMappingShouldWork_NET7_0.verified.txt @@ -176,4 +176,4 @@ }, DateTimeValueTargetDateOnly: 2020-01-03, DateTimeValueTargetTimeOnly: 3:10 PM -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/NET_48/StaticMapperTest.RunMappingShouldWork.verified.txt b/test/Riok.Mapperly.IntegrationTests/_snapshots/StaticMapperTest.RunMappingShouldWork.verified.txt similarity index 99% rename from test/Riok.Mapperly.IntegrationTests/_snapshots/NET_48/StaticMapperTest.RunMappingShouldWork.verified.txt rename to test/Riok.Mapperly.IntegrationTests/_snapshots/StaticMapperTest.RunMappingShouldWork.verified.txt index 42ed5b8902..31cad1c1be 100644 --- a/test/Riok.Mapperly.IntegrationTests/_snapshots/NET_48/StaticMapperTest.RunMappingShouldWork.verified.txt +++ b/test/Riok.Mapperly.IntegrationTests/_snapshots/StaticMapperTest.RunMappingShouldWork.verified.txt @@ -176,4 +176,4 @@ }, DateTimeValueTargetDateOnly: 2020-01-03, DateTimeValueTargetTimeOnly: 3:10 PM -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/StaticMapperTest.RunMappingShouldWork.verified.txt b/test/Riok.Mapperly.IntegrationTests/_snapshots/StaticMapperTest.RunMappingShouldWork_NET6_0.verified.txt similarity index 99% rename from test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/StaticMapperTest.RunMappingShouldWork.verified.txt rename to test/Riok.Mapperly.IntegrationTests/_snapshots/StaticMapperTest.RunMappingShouldWork_NET6_0.verified.txt index 7adc77cebd..4812c0f332 100644 --- a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/StaticMapperTest.RunMappingShouldWork.verified.txt +++ b/test/Riok.Mapperly.IntegrationTests/_snapshots/StaticMapperTest.RunMappingShouldWork_NET6_0.verified.txt @@ -181,4 +181,4 @@ }, DateTimeValueTargetDateOnly: 2020-01-03, DateTimeValueTargetTimeOnly: 3:10 PM -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_4_OR_LOWER/StaticMapperTest.RunMappingShouldWork.verified.txt b/test/Riok.Mapperly.IntegrationTests/_snapshots/StaticMapperTest.RunMappingShouldWork_NET7_0.verified.txt similarity index 99% rename from test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_4_OR_LOWER/StaticMapperTest.RunMappingShouldWork.verified.txt rename to test/Riok.Mapperly.IntegrationTests/_snapshots/StaticMapperTest.RunMappingShouldWork_NET7_0.verified.txt index 7adc77cebd..4812c0f332 100644 --- a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_4_OR_LOWER/StaticMapperTest.RunMappingShouldWork.verified.txt +++ b/test/Riok.Mapperly.IntegrationTests/_snapshots/StaticMapperTest.RunMappingShouldWork_NET7_0.verified.txt @@ -181,4 +181,4 @@ }, DateTimeValueTargetDateOnly: 2020-01-03, DateTimeValueTargetTimeOnly: 3:10 PM -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/NET_48/StaticMapperTest.SnapshotGeneratedSource.verified.cs b/test/Riok.Mapperly.IntegrationTests/_snapshots/StaticMapperTest.SnapshotGeneratedSource.verified.cs similarity index 99% rename from test/Riok.Mapperly.IntegrationTests/_snapshots/NET_48/StaticMapperTest.SnapshotGeneratedSource.verified.cs rename to test/Riok.Mapperly.IntegrationTests/_snapshots/StaticMapperTest.SnapshotGeneratedSource.verified.cs index e48f611e0d..bb31fd6f91 100644 --- a/test/Riok.Mapperly.IntegrationTests/_snapshots/NET_48/StaticMapperTest.SnapshotGeneratedSource.verified.cs +++ b/test/Riok.Mapperly.IntegrationTests/_snapshots/StaticMapperTest.SnapshotGeneratedSource.verified.cs @@ -721,4 +721,4 @@ private static string MapToString1(global::Riok.Mapperly.IntegrationTests.Dto.Te return target; } } -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_4_OR_LOWER/StaticMapperTest.SnapshotGeneratedSource.verified.cs b/test/Riok.Mapperly.IntegrationTests/_snapshots/StaticMapperTest.SnapshotGeneratedSource_NET6_0.verified.cs similarity index 99% rename from test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_4_OR_LOWER/StaticMapperTest.SnapshotGeneratedSource.verified.cs rename to test/Riok.Mapperly.IntegrationTests/_snapshots/StaticMapperTest.SnapshotGeneratedSource_NET6_0.verified.cs index 48c144ef06..d237657d8a 100644 --- a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_4_OR_LOWER/StaticMapperTest.SnapshotGeneratedSource.verified.cs +++ b/test/Riok.Mapperly.IntegrationTests/_snapshots/StaticMapperTest.SnapshotGeneratedSource_NET6_0.verified.cs @@ -721,4 +721,4 @@ private static string MapToString1(global::Riok.Mapperly.IntegrationTests.Dto.Te return target; } } -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/StaticMapperTest.SnapshotGeneratedSource.verified.cs b/test/Riok.Mapperly.IntegrationTests/_snapshots/StaticMapperTest.SnapshotGeneratedSource_NET7_0.verified.cs similarity index 99% rename from test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/StaticMapperTest.SnapshotGeneratedSource.verified.cs rename to test/Riok.Mapperly.IntegrationTests/_snapshots/StaticMapperTest.SnapshotGeneratedSource_NET7_0.verified.cs index 3c64e3b8f2..bd68a4d507 100644 --- a/test/Riok.Mapperly.IntegrationTests/_snapshots/Roslyn_4_5/StaticMapperTest.SnapshotGeneratedSource.verified.cs +++ b/test/Riok.Mapperly.IntegrationTests/_snapshots/StaticMapperTest.SnapshotGeneratedSource_NET7_0.verified.cs @@ -730,4 +730,4 @@ private static string MapToString1(global::Riok.Mapperly.IntegrationTests.Dto.Te return target; } } -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/DerivedTypeTest.WithInterfaceSourceAndTargetNullableShouldWork#Mapper.g.verified.cs b/test/Riok.Mapperly.Tests/_snapshots/DerivedTypeTest.WithInterfaceSourceAndTargetNullableShouldWork#Mapper.g.verified.cs index c1221b2ccf..c02a5bda34 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/DerivedTypeTest.WithInterfaceSourceAndTargetNullableShouldWork#Mapper.g.verified.cs +++ b/test/Riok.Mapperly.Tests/_snapshots/DerivedTypeTest.WithInterfaceSourceAndTargetNullableShouldWork#Mapper.g.verified.cs @@ -28,4 +28,4 @@ public partial class Mapper target.Value2 = source.Value2; return target; } -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/EnumerableTest.ArrayToCollectionShouldUpgradeNullability#Mapper.g.verified.cs b/test/Riok.Mapperly.Tests/_snapshots/EnumerableTest.ArrayToCollectionShouldUpgradeNullability#Mapper.g.verified.cs index 41c4b6b4b3..eaf0d2ab6b 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/EnumerableTest.ArrayToCollectionShouldUpgradeNullability#Mapper.g.verified.cs +++ b/test/Riok.Mapperly.Tests/_snapshots/EnumerableTest.ArrayToCollectionShouldUpgradeNullability#Mapper.g.verified.cs @@ -26,4 +26,4 @@ public partial class Mapper return target; } -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/EnumerableTest.ArrayToReadOnlyCollectionShouldUpgradeNullability#Mapper.g.verified.cs b/test/Riok.Mapperly.Tests/_snapshots/EnumerableTest.ArrayToReadOnlyCollectionShouldUpgradeNullability#Mapper.g.verified.cs index 720b11af25..8d11626f8e 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/EnumerableTest.ArrayToReadOnlyCollectionShouldUpgradeNullability#Mapper.g.verified.cs +++ b/test/Riok.Mapperly.Tests/_snapshots/EnumerableTest.ArrayToReadOnlyCollectionShouldUpgradeNullability#Mapper.g.verified.cs @@ -26,4 +26,4 @@ public partial class Mapper return target; } -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/EnumerableTest.CollectionToReadOnlyCollectionShouldUpgradeNullability#Mapper.g.verified.cs b/test/Riok.Mapperly.Tests/_snapshots/EnumerableTest.CollectionToReadOnlyCollectionShouldUpgradeNullability#Mapper.g.verified.cs index c3a46657fb..398b09076b 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/EnumerableTest.CollectionToReadOnlyCollectionShouldUpgradeNullability#Mapper.g.verified.cs +++ b/test/Riok.Mapperly.Tests/_snapshots/EnumerableTest.CollectionToReadOnlyCollectionShouldUpgradeNullability#Mapper.g.verified.cs @@ -28,4 +28,4 @@ public partial class Mapper return target; } -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/EnumerableTest.ShouldUpgradeNullabilityInDisabledNullableContextInSelectClause#Mapper.g.verified.cs b/test/Riok.Mapperly.Tests/_snapshots/EnumerableTest.ShouldUpgradeNullabilityInDisabledNullableContextInSelectClause#Mapper.g.verified.cs index 1783f071e0..a6bf2b34f0 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/EnumerableTest.ShouldUpgradeNullabilityInDisabledNullableContextInSelectClause#Mapper.g.verified.cs +++ b/test/Riok.Mapperly.Tests/_snapshots/EnumerableTest.ShouldUpgradeNullabilityInDisabledNullableContextInSelectClause#Mapper.g.verified.cs @@ -35,4 +35,4 @@ public partial class Mapper return target; } -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/MapperTest.MapperInNestedClassShouldWork#CarFeature.Mappers.CarMapper.g.verified.cs b/test/Riok.Mapperly.Tests/_snapshots/MapperTest.MapperInNestedClassShouldWork#CarFeature.Mappers.CarMapper.g.verified.cs index 8dbe4cb990..2b6275e42c 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/MapperTest.MapperInNestedClassShouldWork#CarFeature.Mappers.CarMapper.g.verified.cs +++ b/test/Riok.Mapperly.Tests/_snapshots/MapperTest.MapperInNestedClassShouldWork#CarFeature.Mappers.CarMapper.g.verified.cs @@ -13,4 +13,4 @@ public partial int ToInt(double value) } } } -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/MapperTest.MapperInNestedClassesWithAttributesShouldWork#CarFeature.Mappers.CarMapper.g.verified.cs b/test/Riok.Mapperly.Tests/_snapshots/MapperTest.MapperInNestedClassesWithAttributesShouldWork#CarFeature.Mappers.CarMapper.g.verified.cs index 8dbe4cb990..2b6275e42c 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/MapperTest.MapperInNestedClassesWithAttributesShouldWork#CarFeature.Mappers.CarMapper.g.verified.cs +++ b/test/Riok.Mapperly.Tests/_snapshots/MapperTest.MapperInNestedClassesWithAttributesShouldWork#CarFeature.Mappers.CarMapper.g.verified.cs @@ -13,4 +13,4 @@ public partial int ToInt(double value) } } } -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/MapperTest.MapperInNestedClassesWithBaseTypeShouldWork#CarFeature.Mappers.CarMapper.g.verified.cs b/test/Riok.Mapperly.Tests/_snapshots/MapperTest.MapperInNestedClassesWithBaseTypeShouldWork#CarFeature.Mappers.CarMapper.g.verified.cs index 9fa7f5dce3..f91069f6f3 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/MapperTest.MapperInNestedClassesWithBaseTypeShouldWork#CarFeature.Mappers.CarMapper.g.verified.cs +++ b/test/Riok.Mapperly.Tests/_snapshots/MapperTest.MapperInNestedClassesWithBaseTypeShouldWork#CarFeature.Mappers.CarMapper.g.verified.cs @@ -13,4 +13,4 @@ public partial int ToInt(double value) } } } -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/MapperTest.SameMapperNameInMultipleNamespacesShouldWork#FooBarMapper.g.verified.cs b/test/Riok.Mapperly.Tests/_snapshots/MapperTest.SameMapperNameInMultipleNamespacesShouldWork#FooBarMapper.g.verified.cs index 5c481c03ee..50e23dac0e 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/MapperTest.SameMapperNameInMultipleNamespacesShouldWork#FooBarMapper.g.verified.cs +++ b/test/Riok.Mapperly.Tests/_snapshots/MapperTest.SameMapperNameInMultipleNamespacesShouldWork#FooBarMapper.g.verified.cs @@ -10,4 +10,4 @@ internal partial string FooToBar(string value) return value; } } -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/MapperTest.SameMapperNameInMultipleNamespacesShouldWork#FooBarMapper1.g.verified.cs b/test/Riok.Mapperly.Tests/_snapshots/MapperTest.SameMapperNameInMultipleNamespacesShouldWork#FooBarMapper1.g.verified.cs index 98a237bc03..1348774cc2 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/MapperTest.SameMapperNameInMultipleNamespacesShouldWork#FooBarMapper1.g.verified.cs +++ b/test/Riok.Mapperly.Tests/_snapshots/MapperTest.SameMapperNameInMultipleNamespacesShouldWork#FooBarMapper1.g.verified.cs @@ -10,4 +10,4 @@ internal partial string FooToBar(string value) return value; } } -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/MemoryTest.ReadOnlyMemoryToList#Mapper.g.verified.cs b/test/Riok.Mapperly.Tests/_snapshots/MemoryTest.ReadOnlyMemoryToList#Mapper.g.verified.cs index 38742486f9..cc45371d58 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/MemoryTest.ReadOnlyMemoryToList#Mapper.g.verified.cs +++ b/test/Riok.Mapperly.Tests/_snapshots/MemoryTest.ReadOnlyMemoryToList#Mapper.g.verified.cs @@ -19,4 +19,4 @@ public partial class Mapper return target; } -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/MemoryTest.ReadOnlyMemoryToStack#Mapper.g.verified.cs b/test/Riok.Mapperly.Tests/_snapshots/MemoryTest.ReadOnlyMemoryToStack#Mapper.g.verified.cs index 11150d421e..06911b25f8 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/MemoryTest.ReadOnlyMemoryToStack#Mapper.g.verified.cs +++ b/test/Riok.Mapperly.Tests/_snapshots/MemoryTest.ReadOnlyMemoryToStack#Mapper.g.verified.cs @@ -19,4 +19,4 @@ public partial class Mapper return target; } -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyNullableTest.ShouldUpgradeNullabilityInDisabledNullableContextInNestedProperty#Mapper.g.verified.cs b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyNullableTest.ShouldUpgradeNullabilityInDisabledNullableContextInNestedProperty#Mapper.g.verified.cs index 1683adc5f7..c8a01ffaa5 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyNullableTest.ShouldUpgradeNullabilityInDisabledNullableContextInNestedProperty#Mapper.g.verified.cs +++ b/test/Riok.Mapperly.Tests/_snapshots/ObjectPropertyNullableTest.ShouldUpgradeNullabilityInDisabledNullableContextInNestedProperty#Mapper.g.verified.cs @@ -22,4 +22,4 @@ public partial class Mapper target.Value = source.Value; return target; } -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/QueryableProjectionNullableTest.ClassToClassNullableSourceAndTargetPropertyWithNoNullAssignmentAndThrowShouldBeIgnored#Mapper.g.verified.cs b/test/Riok.Mapperly.Tests/_snapshots/QueryableProjectionNullableTest.ClassToClassNullableSourceAndTargetPropertyWithNoNullAssignmentAndThrowShouldBeIgnored#Mapper.g.verified.cs index 6841fe2ee4..0544a452c9 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/QueryableProjectionNullableTest.ClassToClassNullableSourceAndTargetPropertyWithNoNullAssignmentAndThrowShouldBeIgnored#Mapper.g.verified.cs +++ b/test/Riok.Mapperly.Tests/_snapshots/QueryableProjectionNullableTest.ClassToClassNullableSourceAndTargetPropertyWithNoNullAssignmentAndThrowShouldBeIgnored#Mapper.g.verified.cs @@ -1,4 +1,4 @@ -//HintName: Mapper.g.cs +//HintName: Mapper.g.cs // #nullable enable public partial class Mapper @@ -9,4 +9,4 @@ public partial class Mapper return System.Linq.Queryable.Select(source, x => new global::B() { StringValue = x.StringValue }); #nullable enable } -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/SpanTest.SpanToICollection#Mapper.g.verified.cs b/test/Riok.Mapperly.Tests/_snapshots/SpanTest.SpanToICollection#Mapper.g.verified.cs index 31cc87bfde..e0572b3b3a 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/SpanTest.SpanToICollection#Mapper.g.verified.cs +++ b/test/Riok.Mapperly.Tests/_snapshots/SpanTest.SpanToICollection#Mapper.g.verified.cs @@ -19,4 +19,4 @@ public partial class Mapper return target; } -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/SpanTest.SpanToIList#Mapper.g.verified.cs b/test/Riok.Mapperly.Tests/_snapshots/SpanTest.SpanToIList#Mapper.g.verified.cs index 39b36592b1..200f3bc583 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/SpanTest.SpanToIList#Mapper.g.verified.cs +++ b/test/Riok.Mapperly.Tests/_snapshots/SpanTest.SpanToIList#Mapper.g.verified.cs @@ -19,4 +19,4 @@ public partial class Mapper return target; } -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.ExistingTargetsWithClassBaseTypeShouldWork#BaseMapper.g.verified.cs b/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.ExistingTargetsWithClassBaseTypeShouldWork#BaseMapper.g.verified.cs index 4c2cdc3c50..32c5f7586f 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.ExistingTargetsWithClassBaseTypeShouldWork#BaseMapper.g.verified.cs +++ b/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.ExistingTargetsWithClassBaseTypeShouldWork#BaseMapper.g.verified.cs @@ -11,4 +11,4 @@ protected partial void MyIntToShortMapping(global::System.Collections.Generic.Li dst.Add((short)item); } } -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.ExistingTargetsWithClassBaseTypeShouldWork#MyMapper.g.verified.cs b/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.ExistingTargetsWithClassBaseTypeShouldWork#MyMapper.g.verified.cs index 1f5510f802..0c952fbdf8 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.ExistingTargetsWithClassBaseTypeShouldWork#MyMapper.g.verified.cs +++ b/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.ExistingTargetsWithClassBaseTypeShouldWork#MyMapper.g.verified.cs @@ -12,4 +12,4 @@ public partial class MyMapper MyIntToShortMapping(source.Value4, target.Value4); return target; } -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.InstanceMapperShouldSupportUserDefinedStaticMethods#MyMapper.g.verified.cs b/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.InstanceMapperShouldSupportUserDefinedStaticMethods#MyMapper.g.verified.cs index bf2b767370..5f27d44a1e 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.InstanceMapperShouldSupportUserDefinedStaticMethods#MyMapper.g.verified.cs +++ b/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.InstanceMapperShouldSupportUserDefinedStaticMethods#MyMapper.g.verified.cs @@ -8,4 +8,4 @@ public partial class MyMapper var target = new global::B(MapInt(s.Value)); return target; } -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.InstanceMapperShouldUseStaticExistingTargetMethod#Mapper.g.verified.cs b/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.InstanceMapperShouldUseStaticExistingTargetMethod#Mapper.g.verified.cs index 820b7aec2d..1737ae4e24 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.InstanceMapperShouldUseStaticExistingTargetMethod#Mapper.g.verified.cs +++ b/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.InstanceMapperShouldUseStaticExistingTargetMethod#Mapper.g.verified.cs @@ -9,4 +9,4 @@ public partial class Mapper MapList(s.Value, target.Value); return target; } -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.WithExistingInstanceDisabledNullable#Mapper.g.verified.cs b/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.WithExistingInstanceDisabledNullable#Mapper.g.verified.cs index 82eb997b4e..b6d3f9e4a9 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.WithExistingInstanceDisabledNullable#Mapper.g.verified.cs +++ b/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.WithExistingInstanceDisabledNullable#Mapper.g.verified.cs @@ -9,4 +9,4 @@ private partial void Map(global::A? source, global::B? target) return; target.StringValue = source.StringValue; } -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.WithMapperClassModifiersShouldCopyModifiersToMapper#BaseMapper.g.verified.cs b/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.WithMapperClassModifiersShouldCopyModifiersToMapper#BaseMapper.g.verified.cs index dc76ab84f7..3ff04af60f 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.WithMapperClassModifiersShouldCopyModifiersToMapper#BaseMapper.g.verified.cs +++ b/test/Riok.Mapperly.Tests/_snapshots/UserMethodTest.WithMapperClassModifiersShouldCopyModifiersToMapper#BaseMapper.g.verified.cs @@ -15,4 +15,4 @@ protected partial short IntToShort(int value) { return (short)value; } -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/ValueTupleTest.MapPropertyShouldMapFieldAndNestedTuple#Mapper.g.verified.cs b/test/Riok.Mapperly.Tests/_snapshots/ValueTupleTest.MapPropertyShouldMapFieldAndNestedTuple#Mapper.g.verified.cs index 2bd10c69eb..3dcedb3146 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/ValueTupleTest.MapPropertyShouldMapFieldAndNestedTuple#Mapper.g.verified.cs +++ b/test/Riok.Mapperly.Tests/_snapshots/ValueTupleTest.MapPropertyShouldMapFieldAndNestedTuple#Mapper.g.verified.cs @@ -15,4 +15,4 @@ private partial (string E, (long G, int H) F) Map(((int B, int C) A, string D) s var target = (G: (long)source.B, H: source.C); return target; } -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/ValueTupleTest.MapPropertyShouldMapNamedNestedTuple#Mapper.g.verified.cs b/test/Riok.Mapperly.Tests/_snapshots/ValueTupleTest.MapPropertyShouldMapNamedNestedTuple#Mapper.g.verified.cs index 1e534ad529..5b2fb0b73f 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/ValueTupleTest.MapPropertyShouldMapNamedNestedTuple#Mapper.g.verified.cs +++ b/test/Riok.Mapperly.Tests/_snapshots/ValueTupleTest.MapPropertyShouldMapNamedNestedTuple#Mapper.g.verified.cs @@ -15,4 +15,4 @@ private partial ((int, int D) C, int) Map(((int F, int G), string B) source) var target = (source.F, D: source.G); return target; } -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/ValueTupleTest.SimilarTupleMappingShouldCreateSeparateMethods#Mapper.g.verified.cs b/test/Riok.Mapperly.Tests/_snapshots/ValueTupleTest.SimilarTupleMappingShouldCreateSeparateMethods#Mapper.g.verified.cs index 3af7edbdc3..0c9617fb5f 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/ValueTupleTest.SimilarTupleMappingShouldCreateSeparateMethods#Mapper.g.verified.cs +++ b/test/Riok.Mapperly.Tests/_snapshots/ValueTupleTest.SimilarTupleMappingShouldCreateSeparateMethods#Mapper.g.verified.cs @@ -14,4 +14,4 @@ private partial (string A, string B) Map((int B, int A) src) var target = (A: src.A.ToString(), B: src.B.ToString()); return target; } -} +} \ No newline at end of file diff --git a/test/Riok.Mapperly.Tests/_snapshots/ValueTupleTest.TuplePropertyToTupleProperty#Mapper.g.verified.cs b/test/Riok.Mapperly.Tests/_snapshots/ValueTupleTest.TuplePropertyToTupleProperty#Mapper.g.verified.cs index 0c6a2fb5c6..23490ce950 100644 --- a/test/Riok.Mapperly.Tests/_snapshots/ValueTupleTest.TuplePropertyToTupleProperty#Mapper.g.verified.cs +++ b/test/Riok.Mapperly.Tests/_snapshots/ValueTupleTest.TuplePropertyToTupleProperty#Mapper.g.verified.cs @@ -15,4 +15,4 @@ public partial class Mapper var target = (A: source.A.ToString(), source.Item2); return target; } -} +} \ No newline at end of file