We have developed a service using Mapster to map our model and more particularly the Include method to configure the mapping.
public TypeAdapterSetter<TSource, TDestination> Include<TDerivedSource, TDerivedDestination>()
where TDerivedSource : class, TSource
where TDerivedDestination : class, TDestination
{
return this.Include<TypeAdapterSetter<TSource, TDestination>>(typeof (TDerivedSource), typeof (TDerivedDestination));
}
The issue happens when we run the tests (Integration tests). If the test is run unitary, it works. But when all the tests are run, we have the following exception on some tests.
System.ArgumentOutOfRangeException
capacity was less than the current size. (Parameter 'value')
at System.Collections.Generic.List1.set_Capacity(Int32 value) at System.Collections.Generic.List1.Grow(Int32 capacity)
at System.Collections.Generic.List1.AddWithResize(T item) at Mapster.TypeAdapterSetterExtensions.Include[TSetter](TSetter setter, Type sourceType, Type destType) at Mapster.TypeAdapterSetter2.Include[TDerivedSource,TDerivedDestination]()
We have developed a service using Mapster to map our model and more particularly the Include method to configure the mapping.
The issue happens when we run the tests (Integration tests). If the test is run unitary, it works. But when all the tests are run, we have the following exception on some tests.
System.ArgumentOutOfRangeException capacity was less than the current size. (Parameter 'value') at System.Collections.Generic.List
1.set_Capacity(Int32 value) at System.Collections.Generic.List
1.Grow(Int32 capacity) at System.Collections.Generic.List1.AddWithResize(T item) at Mapster.TypeAdapterSetterExtensions.Include[TSetter](TSetter setter, Type sourceType, Type destType) at Mapster.TypeAdapterSetter
2.Include[TDerivedSource,TDerivedDestination]()The code is:
Any idea what could be the issue ?
Thank you ?