public Mock <IServiceProvider> GetServiceProvider(IGarmentDraftPackingListItemRepository repository) { var spMock = new Mock <IServiceProvider>(); spMock.Setup(s => s.GetService(typeof(IGarmentDraftPackingListItemRepository))) .Returns(repository); return(spMock); }
private Mock <IServiceProvider> GetServiceProviderWithIdentity(IGarmentDraftPackingListItemRepository repository) { var spMock = new Mock <IServiceProvider>(); spMock.Setup(s => s.GetService(typeof(IGarmentDraftPackingListItemRepository))) .Returns(repository); spMock.Setup(s => s.GetService(typeof(IIdentityProvider))) .Returns(new IdentityProvider { TimezoneOffset = 7, Token = "INITOKEN", Username = "******" }); return(spMock); }
public GarmentDraftPackingListItemService(IServiceProvider serviceProvider) { _draftPackingListItemRepository = serviceProvider.GetService <IGarmentDraftPackingListItemRepository>(); _identityProvider = serviceProvider.GetService <IIdentityProvider>(); _azureImageService = serviceProvider.GetService <IAzureImageService>(); }