public void Get_Success_Empty_Excel() { var dbContext = DbContext(GetCurrentMethod()); var serviceProvider = GetServiceProviderMock(dbContext).Object; var filter = new { status = "NOT OK" }; var facade = new AvailableBudgetReportFacade(serviceProvider); var Response = facade.GenerateExcel(filter: JsonConvert.SerializeObject(filter)); Assert.NotNull(Response.Item2); }
public async void Get_Success_Excel() { var dbContext = DbContext(GetCurrentMethod()); var serviceProvider = GetServiceProviderMock(dbContext).Object; CostCalculationGarmentFacade costCalculationGarmentFacade = new CostCalculationGarmentFacade(serviceProvider, dbContext); var data = await DataUtil(costCalculationGarmentFacade, serviceProvider, dbContext).GetNewData(); await costCalculationGarmentFacade.CreateAsync(data); var data1 = await DataUtil(costCalculationGarmentFacade, serviceProvider, dbContext).GetNewData(); data1.LeadTime = 35; await costCalculationGarmentFacade.CreateAsync(data1); var AvailableBy = "AvailableBy"; await costCalculationGarmentFacade.AcceptanceCC(new List <long> { data.Id }, AvailableBy); await costCalculationGarmentFacade.AvailableCC(new List <long> { data.Id }, AvailableBy); JsonPatchDocument <CostCalculationGarment> jsonPatch = new JsonPatchDocument <CostCalculationGarment>(); jsonPatch.Replace(m => m.IsApprovedPPIC, true); jsonPatch.Replace(m => m.ApprovedPPICBy, "Super Man"); jsonPatch.Replace(m => m.ApprovedPPICDate, DateTimeOffset.Now); await costCalculationGarmentFacade.Patch(data.Id, jsonPatch); var filter = new { section = data.Section, //roNo = data.RO_Number, //buyer = data.BuyerBrandCode, availableDateStart = data.DeliveryDate.AddDays(-30), availableDateEnd = data.DeliveryDate.AddDays(30), //status = "OK" }; var facade = new AvailableBudgetReportFacade(serviceProvider); var Response = facade.GenerateExcel(filter: JsonConvert.SerializeObject(filter)); Assert.NotNull(Response.Item2); }