Skip to content

Commit 071ad1a

Browse files
HenkKinHenk Kin
andauthored
Update to automapper v15 (#35)
* Updated to Automapper v15.0.1 --------- Co-authored-by: Henk Kin <[email protected]>
1 parent f4760a5 commit 071ad1a

18 files changed

+60
-47
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ jobs:
1111
build:
1212
strategy:
1313
fail-fast: false
14+
matrix:
15+
dotnet-version: [8.0.x]
1416
runs-on: windows-latest
1517
steps:
1618
- name: Checkout

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ jobs:
88
build:
99
strategy:
1010
fail-fast: false
11+
matrix:
12+
dotnet-version: [8.0.x]
1113
runs-on: windows-latest
1214
steps:
1315
- name: Checkout

src/AutoMapper.Extensions.EnumMapping.Tests/AutoMapper.Extensions.EnumMapping.Tests.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="AutoMapper" Version="[14,)" />
10-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
11-
<PackageReference Include="Shouldly" Version="4.2.1" />
12-
<PackageReference Include="xunit" Version="2.9.2" />
13-
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
9+
<PackageReference Include="AutoMapper" Version="[15.0.1,)" />
10+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
11+
<PackageReference Include="Shouldly" Version="4.3.0" />
12+
<PackageReference Include="xunit" Version="2.9.3" />
13+
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.4">
1414
<PrivateAssets>all</PrivateAssets>
1515
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1616
</PackageReference>

src/AutoMapper.Extensions.EnumMapping.Tests/EnumMappingType.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class Default : AutoMapperSpecBase
3030
cfg.EnableEnumMappingValidation();
3131
cfg.CreateMap<Source, Destination>()
3232
.ConvertUsingEnumMapping();
33-
});
33+
}, _loggerFactory);
3434

3535
protected override void Because_of()
3636
{
@@ -57,7 +57,7 @@ public class ByName : AutoMapperSpecBase
5757
cfg.EnableEnumMappingValidation();
5858
cfg.CreateMap<Source, Destination>()
5959
.ConvertUsingEnumMapping(opt => opt.MapByName());
60-
});
60+
}, _loggerFactory);
6161

6262
protected override void Because_of()
6363
{
@@ -84,7 +84,7 @@ public class ByValue : AutoMapperSpecBase
8484
cfg.EnableEnumMappingValidation();
8585
cfg.CreateMap<Source, Destination>()
8686
.ConvertUsingEnumMapping(opt => opt.MapByValue());
87-
});
87+
}, _loggerFactory);
8888

8989
protected override void Because_of()
9090
{

src/AutoMapper.Extensions.EnumMapping.Tests/EnumMappingValidation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ public class Default : AutoMapperSpecBase
1010
{
1111
cfg.EnableEnumMappingValidation();
1212
cfg.CreateMap<object, object>();
13-
});
13+
}, _loggerFactory);
1414
}
1515
}

src/AutoMapper.Extensions.EnumMapping.Tests/EnumValueMappingByName.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public enum Destination { Default, Bar, Foo }
1818
cfg.EnableEnumMappingValidation();
1919
cfg.CreateMap<Source, Destination>()
2020
.ConvertUsingEnumMapping(opt => opt.MapByName());
21-
});
21+
}, _loggerFactory);
2222

2323
protected override void Because_of()
2424
{
@@ -44,7 +44,7 @@ public enum Destination { fOObAR, DefaulT, Bar, Foo }
4444
cfg.EnableEnumMappingValidation();
4545
cfg.CreateMap<Source, Destination>()
4646
.ConvertUsingEnumMapping(opt => opt.MapByName(true));
47-
});
47+
}, _loggerFactory);
4848

4949
protected override void Because_of()
5050
{
@@ -73,7 +73,7 @@ public enum Destination { Default, Foo }
7373
.ConvertUsingEnumMapping(opt => opt
7474
.MapByName()
7575
.MapValue(Source.Bar, Destination.Foo));
76-
});
76+
}, _loggerFactory);
7777

7878
protected override void Because_of()
7979
{
@@ -97,7 +97,7 @@ public enum Destination { Default, Bar }
9797
cfg.EnableEnumMappingValidation();
9898
cfg.CreateMap<Source, Destination>()
9999
.ConvertUsingEnumMapping(opt => opt.MapByName());
100-
});
100+
}, _loggerFactory);
101101

102102
[Fact]
103103
public void Should_fail_validation() =>
@@ -118,7 +118,7 @@ public enum Destination { Default, Foo }
118118
.ConvertUsingEnumMapping(opt => opt
119119
.MapByName()
120120
.MapValue(Source.Bar, Destination.Foo));
121-
});
121+
}, _loggerFactory);
122122

123123
[Fact]
124124
public void Should_fail_validation() =>

src/AutoMapper.Extensions.EnumMapping.Tests/EnumValueMappingByValue.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public enum Destination { Default, Bar, Foo }
1818
cfg.EnableEnumMappingValidation();
1919
cfg.CreateMap<Source, Destination>()
2020
.ConvertUsingEnumMapping(opt => opt.MapByValue());
21-
});
21+
}, _loggerFactory);
2222

2323
protected override void Because_of()
2424
{
@@ -47,7 +47,7 @@ public enum Destination { Default, Bar }
4747
.ConvertUsingEnumMapping(opt => opt
4848
.MapByValue()
4949
.MapValue(Source.Bar, Destination.Bar));
50-
});
50+
}, _loggerFactory);
5151

5252
protected override void Because_of()
5353
{
@@ -71,7 +71,7 @@ public enum Destination { Default, Bar }
7171
cfg.EnableEnumMappingValidation();
7272
cfg.CreateMap<Source, Destination>()
7373
.ConvertUsingEnumMapping(opt => opt.MapByValue());
74-
});
74+
}, _loggerFactory);
7575

7676
[Fact]
7777
public void Should_fail_validation() =>
@@ -92,7 +92,7 @@ public enum Destination { Default, Bar }
9292
.ConvertUsingEnumMapping(opt => opt
9393
.MapByValue()
9494
.MapValue(Source.Bar, Destination.Bar));
95-
});
95+
}, _loggerFactory);
9696

9797
[Fact]
9898
public void Should_fail_validation() =>

src/AutoMapper.Extensions.EnumMapping.Tests/EnumValueMappingToException.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public enum Destination { A = 2 }
2121
.MapValue(Source.A, Destination.A)
2222
.MapException(Source.B, () => new NotSupportedException($"B is not valid value"))
2323
);
24-
});
24+
}, _loggerFactory);
2525

2626
protected override void Because_of()
2727
{
@@ -49,7 +49,7 @@ public enum Destination { A = 2 }
4949
.MapValue(Source.A, Destination.A)
5050
.MapException(Source.B, () => new NotSupportedException($"B is not valid value"))
5151
);
52-
});
52+
}, _loggerFactory);
5353

5454
protected override void Because_of()
5555
{

src/AutoMapper.Extensions.EnumMapping.Tests/EnumValueWithOtherUnderlyingTypeMapping.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public enum Destination : byte { Default, Bar, Foo }
1515
cfg.EnableEnumMappingValidation();
1616
cfg.CreateMap<Source, Destination>()
1717
.ConvertUsingEnumMapping(opt => opt.MapByValue());
18-
});
18+
}, _loggerFactory);
1919

2020
protected override void Because_of()
2121
{

src/AutoMapper.Extensions.EnumMapping.Tests/Internal/SpecBaseBase.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1-
namespace AutoMapper.Extensions.EnumMapping.Tests.Internal
1+
using Microsoft.Extensions.Logging;
2+
3+
namespace AutoMapper.Extensions.EnumMapping.Tests.Internal
24
{
35
public abstract class SpecBaseBase
46
{
7+
protected static ILoggerFactory _loggerFactory;
8+
9+
static SpecBaseBase()
10+
{
11+
_loggerFactory = new LoggerFactory();
12+
}
13+
514
protected virtual void MainSetup()
615
{
716
Establish_context();

0 commit comments

Comments
 (0)