예제 #1
0
        public async void Get_Excel_Error()
        {
            var dbContext       = DbContext(GetCurrentMethod());
            var serviceProvider = GetServiceProviderMock(dbContext).Object;

            CostCalculationGarmentFacade facade = new CostCalculationGarmentFacade(serviceProvider, dbContext);

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

            ICostCalculationGarmentByUnitReport costCalculationGarmentByUnitReport = new CostCalculationGarmentByUnitReportFacade(serviceProvider, dbContext);

            var filter = new
            {
                unitName = data.UnitName,
                dateFrom = data.ConfirmDate.AddDays(30),
                dateTo   = data.ConfirmDate.AddDays(30)
            };

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

            Assert.NotNull(Response.Item2);
        }
예제 #2
0
        public async void Get_Report_Success()
        {
            var dbContext       = DbContext(GetCurrentMethod());
            var serviceProvider = GetServiceProviderMock(dbContext).Object;

            CostCalculationGarmentFacade facade = new CostCalculationGarmentFacade(serviceProvider, dbContext);

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

            ICostCalculationGarmentByUnitReport costCalculationGarmentByUnitReport = new CostCalculationGarmentByUnitReportFacade(serviceProvider, dbContext);

            var filter = new
            {
                unitName = data.UnitName,
                dateFrom = data.ConfirmDate,
                dateTo   = data.ConfirmDate,
            };

            var Response = costCalculationGarmentByUnitReport.Read(filter: JsonConvert.SerializeObject(filter));

            Assert.NotEqual(Response.Item2, 0);
        }