diff --git a/test/Riok.Mapperly.IntegrationTests/Dto/TestObjectDto.cs b/test/Riok.Mapperly.IntegrationTests/Dto/TestObjectDto.cs index c5d8408d32..ad4b5ee476 100644 --- a/test/Riok.Mapperly.IntegrationTests/Dto/TestObjectDto.cs +++ b/test/Riok.Mapperly.IntegrationTests/Dto/TestObjectDto.cs @@ -99,9 +99,9 @@ public TestObjectDto(int ctorValue, int unknownValue = 10, int ctorValue2 = 100) public IReadOnlySet IReadOnlySet { get; set; } = new HashSet(); #endif - public HashSet HashSet { get; set; } = []; + public HashSet HashSet { get; set; } = new(); - public SortedSet SortedSet { get; set; } = []; + public SortedSet SortedSet { get; set; } = new(); public TestEnumDtoByValue EnumValue { get; set; } @@ -131,7 +131,7 @@ public TestObjectDto(int ctorValue, int unknownValue = 10, int ctorValue2 = 100) public TimeOnly DateTimeValueTargetTimeOnly { get; set; } - public byte[] ToByteArrayWithInstanceMethod { get; set; } = []; + public byte[]? ToByteArrayWithInstanceMethod { get; set; } public int WithCreateMethod { get; set; } diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/MapperTest.SnapshotGeneratedSource_NET8_0.verified.cs b/test/Riok.Mapperly.IntegrationTests/_snapshots/MapperTest.SnapshotGeneratedSource_NET8_0.verified.cs index 00634d6e33..804f7f7252 100644 --- a/test/Riok.Mapperly.IntegrationTests/_snapshots/MapperTest.SnapshotGeneratedSource_NET8_0.verified.cs +++ b/test/Riok.Mapperly.IntegrationTests/_snapshots/MapperTest.SnapshotGeneratedSource_NET8_0.verified.cs @@ -388,7 +388,10 @@ public partial byte[] ConvertWithInstanceMethod(global::System.Guid id) { target.SubObject = null; } - target.ToByteArrayWithInstanceMethod = new global::System.Guid(dto.ToByteArrayWithInstanceMethod); + if (dto.ToByteArrayWithInstanceMethod != null) + { + target.ToByteArrayWithInstanceMethod = new global::System.Guid(dto.ToByteArrayWithInstanceMethod); + } target.WithCreateMethod = global::Riok.Mapperly.IntegrationTests.Models.ConvertWithStaticMethodObject.Create(dto.WithCreateMethod); target.WithCreateFromMethod = global::Riok.Mapperly.IntegrationTests.Models.ConvertWithStaticMethodObject.CreateFrom(dto.WithCreateFromMethod); target.WithFromSingleMethod = global::Riok.Mapperly.IntegrationTests.Models.ConvertWithStaticMethodObject.FromSingle(dto.WithFromSingleMethod); diff --git a/test/Riok.Mapperly.IntegrationTests/_snapshots/StaticMapperTest.SnapshotGeneratedSource_NET6_0.verified.cs b/test/Riok.Mapperly.IntegrationTests/_snapshots/StaticMapperTest.SnapshotGeneratedSource_NET6_0.verified.cs index f2d42e097f..c4d13f4b0e 100644 --- a/test/Riok.Mapperly.IntegrationTests/_snapshots/StaticMapperTest.SnapshotGeneratedSource_NET6_0.verified.cs +++ b/test/Riok.Mapperly.IntegrationTests/_snapshots/StaticMapperTest.SnapshotGeneratedSource_NET6_0.verified.cs @@ -562,7 +562,10 @@ public static partial void MapIdTargetFirst(global::Riok.Mapperly.IntegrationTes { target.SubObject = null; } - target.ToByteArrayWithInstanceMethod = new global::System.Guid(dto.ToByteArrayWithInstanceMethod); + if (dto.ToByteArrayWithInstanceMethod != null) + { + target.ToByteArrayWithInstanceMethod = new global::System.Guid(dto.ToByteArrayWithInstanceMethod); + } target.WithCreateMethod = global::Riok.Mapperly.IntegrationTests.Models.ConvertWithStaticMethodObject.Create(dto.WithCreateMethod); target.WithCreateFromMethod = global::Riok.Mapperly.IntegrationTests.Models.ConvertWithStaticMethodObject.CreateFrom(dto.WithCreateFromMethod); target.WithFromSingleMethod = global::Riok.Mapperly.IntegrationTests.Models.ConvertWithStaticMethodObject.FromSingle(dto.WithFromSingleMethod);