public void Should_Success_GenerateExcelDeliveryDetail() { GarmentDeliveryOrderFacade facade = new GarmentDeliveryOrderFacade(GetServiceProvider().Object, _dbContext(GetCurrentMethod())); var Response = facade.GenerateExcelDeliveryDetail("", DateTime.Now, DateTime.Now, "", "", 0); Assert.NotNull(Response); }
public async Task Should_Success_Get_Report_AccuracyDelivery_Excel() { GarmentDeliveryOrderFacade facade = new GarmentDeliveryOrderFacade(GetServiceProvider().Object, _dbContext(GetCurrentMethod())); var data = await dataUtil(facade, GetCurrentMethod()).GetNewData3(); await facade.Create(data, USERNAME); var data2 = await dataUtil(facade, GetCurrentMethod()).GetNewData3(); data2.DODate = DateTimeOffset.Now.AddDays(10); foreach (var item in data2.Items) { foreach (var detail in item.Details) { detail.ProductCode = "SUB"; } } await facade.Create(data2, USERNAME); var data3 = await dataUtil(facade, GetCurrentMethod()).GetNewData3(); data3.DODate = DateTimeOffset.Now.AddDays(10); foreach (var item in data3.Items) { foreach (var detail in item.Details) { detail.ProductCode = "SUB"; } } await facade.Create(data3, USERNAME); var data4 = await dataUtil(facade, GetCurrentMethod()).GetNewData3(); data4.DODate = DateTimeOffset.Now.AddDays(10); foreach (var item in data4.Items) { foreach (var detail in item.Details) { detail.ProductCode = "LBL"; } } await facade.Create(data4, USERNAME); var Facade = new GarmentDeliveryOrderFacade(ServiceProvider, _dbContext(GetCurrentMethod())); var Response = Facade.GenerateExcelDeliveryHeader(null, null, 7); Assert.IsType(typeof(System.IO.MemoryStream), Response); long nowTicks = DateTimeOffset.Now.Ticks; string nowTicksA = $"{nowTicks}a"; var Response1 = Facade.GenerateExcelDeliveryDetail($"BuyerCode{nowTicksA}", null, null, 7); Assert.IsType(typeof(System.IO.MemoryStream), Response1); }