From fdcd206e1b0aff069ce3d3e665e2ab4a24ed3011 Mon Sep 17 00:00:00 2001 From: TonEnfer Date: Mon, 9 Dec 2024 04:01:04 +0500 Subject: [PATCH] Fix tests for net48, net6.0, net 7.0 --- test/Riok.Mapperly.IntegrationTests/Mapper/TestMapper.cs | 2 ++ .../MapperTest.RunMappingShouldWork_NET6_0.verified.txt | 9 +++++++++ ...MapperTest.SnapshotGeneratedSource_NET6_0.verified.cs | 6 ++++++ 3 files changed, 17 insertions(+) diff --git a/test/Riok.Mapperly.IntegrationTests/Mapper/TestMapper.cs b/test/Riok.Mapperly.IntegrationTests/Mapper/TestMapper.cs index 633f390f16..5d44cf4af7 100644 --- a/test/Riok.Mapperly.IntegrationTests/Mapper/TestMapper.cs +++ b/test/Riok.Mapperly.IntegrationTests/Mapper/TestMapper.cs @@ -51,7 +51,9 @@ public TestMapper() public partial DateTime DirectDateTime(DateTime dateTime); +#if NET5_0_OR_GREATER public partial byte[] ConvertWithInstanceMethod(Guid id); +#endif public partial IEnumerable MapAllDtos(IEnumerable objects); diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/MapperTest.RunMappingShouldWork_NET6_0.verified.txt b/test/Riok.Mapperly.IntegrationTests/_snapshots/MapperTest.RunMappingShouldWork_NET6_0.verified.txt index c6ed90f472..c78c4ad162 100644 --- a/test/Riok.Mapperly.IntegrationTests/_snapshots/MapperTest.RunMappingShouldWork_NET6_0.verified.txt +++ b/test/Riok.Mapperly.IntegrationTests/_snapshots/MapperTest.RunMappingShouldWork_NET6_0.verified.txt @@ -50,6 +50,7 @@ EnumName: Value30, EnumStringValue: 0, EnumReverseStringValue: DtoValue3, + ToByteArrayWithInstanceMethod: AAAAAAAAAAAAAAAAAAAAAA==, FormattedIntValue: CHF 0.00, FormattedDateValue: Monday, January 1, 0001, ExposePrivateValue: 26 @@ -194,6 +195,14 @@ }, DateTimeValueTargetDateOnly: 2020-01-03, DateTimeValueTargetTimeOnly: 3:10 PM, + ToByteArrayWithInstanceMethod: AQAAAAIAAwAEBQYHCAkKCw==, + WithCreateMethod: 10, + WithCreateFromMethod: 20, + WithFromSingleMethod: 30.0, + WithCreateParamsMethod: 40.0, + WithCreateFromParamsMethod: 50, + WithFromShortParamsMethod: 60, + WithToDecimalMethod: 70.0, FormattedIntValue: CHF 10.00, FormattedDateValue: Friday, January 3, 2020, ExposePrivateValue: 28, diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/MapperTest.SnapshotGeneratedSource_NET6_0.verified.cs b/test/Riok.Mapperly.IntegrationTests/_snapshots/MapperTest.SnapshotGeneratedSource_NET6_0.verified.cs index 9594de4ef7..2027ef7fd1 100644 --- a/test/Riok.Mapperly.IntegrationTests/_snapshots/MapperTest.SnapshotGeneratedSource_NET6_0.verified.cs +++ b/test/Riok.Mapperly.IntegrationTests/_snapshots/MapperTest.SnapshotGeneratedSource_NET6_0.verified.cs @@ -46,6 +46,12 @@ public partial int ParseableInt(string value) return dateTime; } + [global::System.CodeDom.Compiler.GeneratedCode("Riok.Mapperly", "0.0.1.0")] + public partial byte[] ConvertWithInstanceMethod(global::System.Guid id) + { + return id.ToByteArray(); + } + [global::System.CodeDom.Compiler.GeneratedCode("Riok.Mapperly", "0.0.1.0")] public partial global::System.Collections.Generic.IEnumerable MapAllDtos(global::System.Collections.Generic.IEnumerable objects) {