【发布时间】:2021-01-05 01:23:56
【问题描述】:
我尝试为映射器最小起订量对象创建,但它不起作用任何人都可以帮助了解如何在服务方法中运行测试用例时访问映射解决方案。我试过下面的代码
private Mock<IMapper> _mapper = new Mock<IMapper>();
我通过服务依赖注入
_abcService = new AbcService(_mapper.Object);
System.NullReferenceException: 'Object reference not set to an instance of an object.'
收到此错误
【问题讨论】:
标签: asp.net-core entity-framework-core xunit