Beispiel #1
0
        public async Task GetLastDataByUnitStorage_Success()
        {
            var serviceProvider = GetServiceProviderMock().Object;
            var dbContext       = _dbContext(GetCurrentMethod());
            var facade          = new GarmentStockOpnameFacade(serviceProvider, dbContext);
            var data            = await dataUtil(facade, serviceProvider, dbContext).GetTestData();

            var Response = facade.GetLastDataByUnitStorage(data.UnitCode, data.StorageCode);

            Assert.NotEqual(0, Response.Id);
        }
Beispiel #2
0
        public async Task Read_Success()
        {
            var serviceProvider = GetServiceProviderMock().Object;
            var dbContext       = _dbContext(GetCurrentMethod());
            var facade          = new GarmentStockOpnameFacade(serviceProvider, dbContext);
            var data            = await dataUtil(facade, serviceProvider, dbContext).GetTestData();

            var Response = facade.Read();

            Assert.NotEmpty(Response.Data);
        }
Beispiel #3
0
        public async Task Download_Success()
        {
            var serviceProvider = GetServiceProviderMock().Object;
            var dbContext       = _dbContext(GetCurrentMethod());
            var facade          = new GarmentStockOpnameFacade(serviceProvider, dbContext);
            var data            = await dataUtil(facade, serviceProvider, dbContext).GetNewData();

            var firstData = data.First();

            var Response = facade.Download(DateTimeOffset.Now, firstData.UnitCode, firstData.StorageCode, firstData.StorageName);

            Assert.IsType <MemoryStream>(Response);
        }
Beispiel #4
0
        public async Task Upload_Success()
        {
            var serviceProvider = GetServiceProviderMock().Object;
            var dbContext       = _dbContext(GetCurrentMethod());
            var facade          = new GarmentStockOpnameFacade(serviceProvider, dbContext);
            var dataUtil        = this.dataUtil(facade, serviceProvider, dbContext);
            var data            = await dataUtil.GetNewData();

            var firstData = data.First();
            var excel     = dataUtil.GetExcel(data, null, firstData.UnitCode, firstData.StorageCode, firstData.StorageName);

            var Response = await facade.Upload(excel);

            Assert.NotEqual(0, Response.Id);
        }
Beispiel #5
0
        private GarmentStockOpnameDataUtil dataUtil(GarmentStockOpnameFacade facade, IServiceProvider serviceProvider, PurchasingDbContext dbContext)
        {
            var garmentPurchaseRequestFacade   = new GarmentPurchaseRequestFacade(serviceProvider, dbContext);
            var garmentPurchaseRequestDataUtil = new GarmentPurchaseRequestDataUtil(garmentPurchaseRequestFacade);

            var garmentInternalPurchaseOrderFacade   = new GarmentInternalPurchaseOrderFacade(dbContext);
            var garmentInternalPurchaseOrderDataUtil = new GarmentInternalPurchaseOrderDataUtil(garmentInternalPurchaseOrderFacade, garmentPurchaseRequestDataUtil);

            var garmentExternalPurchaseOrderFacade   = new GarmentExternalPurchaseOrderFacade(serviceProvider, dbContext);
            var garmentExternalPurchaseOrderDataUtil = new GarmentExternalPurchaseOrderDataUtil(garmentExternalPurchaseOrderFacade, garmentInternalPurchaseOrderDataUtil);

            var garmentDeliveryOrderFacade   = new GarmentDeliveryOrderFacade(serviceProvider, dbContext);
            var garmentDeliveryOrderDataUtil = new GarmentDeliveryOrderDataUtil(garmentDeliveryOrderFacade, garmentExternalPurchaseOrderDataUtil);

            var garmentUnitReceiptNoteFacade   = new GarmentUnitReceiptNoteFacade(serviceProvider, dbContext);
            var garmentUnitReceiptNoteDataUtil = new GarmentUnitReceiptNoteDataUtil(garmentUnitReceiptNoteFacade, garmentDeliveryOrderDataUtil);

            return(new GarmentStockOpnameDataUtil(facade, garmentUnitReceiptNoteDataUtil));
        }
Beispiel #6
0
 public GarmentStockOpnameDataUtil(GarmentStockOpnameFacade facade, GarmentUnitReceiptNoteDataUtil garmentUnitReceiptNoteDataUtil)
 {
     this.facade = facade;
     this.unitReceiptNoteDataUtil = garmentUnitReceiptNoteDataUtil;
 }