public EmployeesServiceTests() { var services = new ServiceCollection(); services.AddScoped <IUnitOfWork, UnitOfWork>(); this._context = ContextMock.Seed(); var mappingConfig = new MapperConfiguration(mc => { mc.AddProfile(new SettingAutomapper()); }); this._mapper = mappingConfig.CreateMapper(); services.AddSingleton(_mapper); }