Hello,
I am getting following error when working with unit tests in ABP project template.
System.InvalidOperationException : Mapper not initialized. Call Initialize with appropriate configuration. If you are trying to use mapper instances through a container or otherwise, make sure you do not have any calls to the static Mapper.Map methods, and if you're using ProjectTo or UseAsDataSource extension methods, make sure you pass in the appropriate IConfigurationProvider instance.
I have following in my GetList Method in ProductAppService Class.
return new ListResultDto<ProductDto>(countries.MapTo<List<ProductDto>>());
This works fine in web but throw error with Unit Tests.
Thanks.
1 Answer(s)
-
0
Hi,
This might be the same problem you area facing <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/1386">https://github.com/aspnetboilerplate/as ... ssues/1386</a>.