Skip to content

Commit 45b31c5

Browse files
committed
Update test to not use the static Mapper.Instance and instead force to use the overload that takes the instance in the test.
1 parent 8053a13 commit 45b31c5

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/AutoMapper.Collection.Tests/ValueTypeTests.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ public class ValueTypeTests
1313
[Fact]
1414
public void MapValueTypes()
1515
{
16-
Mapper.Reset();
17-
Mapper.Initialize(c =>
16+
var mapper = new Mapper(new MapperConfiguration(c =>
1817
{
1918
c.AddCollectionMappers();
2019

@@ -24,7 +23,7 @@ public void MapValueTypes()
2423

2524
c.CreateMap<int, PersonNationality>()
2625
.EqualityComparison((src, dest) => dest.NationalityCountryId == src);
27-
});
26+
}));
2827

2928
var persons = new[]
3029
{
@@ -37,7 +36,7 @@ public void MapValueTypes()
3736
var country = new Country { Persons = new List<PersonNationality>(persons) };
3837
var countryDto = new CountryDto { Nationalities = new List<int> { 104, 103, 105 } };
3938

40-
Mapper.Map(countryDto, country);
39+
mapper.Map(countryDto, country);
4140

4241
Assert.NotStrictEqual(new[] { persons[3], persons[2], country.Persons.Last() }, country.Persons);
4342
Assert.Equal(0, country.Persons.Last().PersonId);

0 commit comments

Comments
 (0)