public TransferStockController(IServiceProvider serviceProvider, IMapper mapper, TransferStockFacade facade)
 {
     this.serviceProvider = serviceProvider;
     this.mapper          = mapper;
     this.facade          = facade;
     this.identityService = (IdentityService)serviceProvider.GetService(typeof(IdentityService));
 }
Beispiel #2
0
        public async Task Should_Success_Create_Data_GTM_AlredyExist()
        {
            TransferOutFacade   facade = new TransferOutFacade(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));
            TransferStockFacade returnToCenterFacade = new TransferStockFacade(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));
            var model = await dataUtil(facade, GetCurrentMethod()).GetNewDataForTransfer();

            var viewmodel = dataUtil(facade, GetCurrentMethod()).MapToViewModel(model);
            var Response  = await returnToCenterFacade.Create(viewmodel, model, USERNAME);

            Assert.NotEqual(0, Response);
        }
Beispiel #3
0
        public async Task Should_Success_Get_Data_By_Id()
        {
            TransferOutFacade   facade = new TransferOutFacade(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));
            TransferStockFacade returnToCenterFacade = new TransferStockFacade(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));
            var model = await dataUtil(facade, GetCurrentMethod()).GetNewData();

            var viewmodel = dataUtil(facade, GetCurrentMethod()).MapToViewModel(model);
            await returnToCenterFacade.Create(viewmodel, model, USERNAME);

            var Response = returnToCenterFacade.ReadById((int)model.Id);

            Assert.NotNull(Response);
        }
 public TransferStockReportController(IMapper mapper, TransferStockFacade facade, IdentityService identityService)
 {
     this.mapper          = mapper;
     this.facade          = facade;
     this.identityService = identityService;
 }