📜  unittest servicector automapper - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:20.494000             🧑  作者: Mango

代码示例1
public TestsCtor()
{
    _fixture = new Fixture().Customize(new AutoMoqCustomization());
    var converterLogger = _fixture.Freeze>>();
    var automapperServiceCtor = _fixture.Freeze>>();
    automapperServiceCtor.Setup(x => x.Invoke(typeof(ILogger))).Returns(converterLogger.Object);
    var mapperConfig = new MapperConfiguration(cfg => {
        cfg.ConstructServicesUsing(automapperServiceCtor.Object);
        cfg.AddProfile(); 
    });
    _mapper = new Mapper(mapperConfig);
}