Beispiel #1
0
        protected GarmentSalesContractDataUtil DataUtil(GarmentSalesContractFacade facade, SalesDbContext dbContext = null)
        {
            var serviceProvider = GetServiceProviderMock(dbContext).Object;

            GarmentPreSalesContractFacade   garmentPreSalesContractFacade   = new GarmentPreSalesContractFacade(serviceProvider, dbContext);
            GarmentPreSalesContractDataUtil garmentPreSalesContractDataUtil = new GarmentPreSalesContractDataUtil(garmentPreSalesContractFacade);

            CostCalculationGarmentFacade   costCalculationGarmentFacade   = new CostCalculationGarmentFacade(serviceProvider, dbContext);
            CostCalculationGarmentDataUtil costCalculationGarmentDataUtil = new CostCalculationGarmentDataUtil(costCalculationGarmentFacade, garmentPreSalesContractDataUtil);

            GarmentSalesContractFacade   garmentSalesContractFacade   = new GarmentSalesContractFacade(serviceProvider, dbContext);
            GarmentSalesContractDataUtil garmentSalesContractDataUtil = new GarmentSalesContractDataUtil(garmentSalesContractFacade, costCalculationGarmentDataUtil);

            return(garmentSalesContractDataUtil);
        }
Beispiel #2
0
        public async void Get_Excel_Success()
        {
            var dbContext       = DbContext(GetCurrentMethod());
            var serviceProvider = GetServiceProviderMock(dbContext).Object;

            GarmentSalesContractFacade facade = new GarmentSalesContractFacade(serviceProvider, dbContext);

            var data = await DataUtil(facade, dbContext).GetTestData();

            ICostCalculationGarmentByBuyer2Report costCalculationGarmentByBuyer2Report = new CostCalculationGarmentByBuyer2ReportFacade(serviceProvider, dbContext);

            var filter = new
            {
                buyerAgent = "Test",
                buyerBrand = data.BuyerBrandCode,
                year       = DateTimeOffset.Now.Year,
            };

            var Response = costCalculationGarmentByBuyer2Report.GenerateExcel(filter: JsonConvert.SerializeObject(filter));

            Assert.NotNull(Response.Item2);
        }