public Mock <IServiceProvider> GetServiceProvider(IWarpTypeRepository repository) { var spMock = new Mock <IServiceProvider>(); spMock.Setup(s => s.GetService(typeof(IWarpTypeRepository))) .Returns(repository); return(spMock); }
public WarpTypeService(IServiceProvider serviceProvider) { _repository = serviceProvider.GetService <IWarpTypeRepository>(); }