예제 #1
0
        private GarmentCorrectionNoteDataUtil dataUtil(GarmentCorrectionNoteFacade facade, string testName)
        {
            HttpResponseMessage httpResponseMessage = new HttpResponseMessage(HttpStatusCode.OK);

            httpResponseMessage.Content = new StringContent("{\"apiVersion\":\"1.0\",\"statusCode\":200,\"message\":\"Ok\",\"data\":[{\"Id\":7,\"code\":\"USD\",\"rate\":13700.0,\"date\":\"2018/10/20\"}],\"info\":{\"count\":1,\"page\":1,\"size\":1,\"total\":2,\"order\":{\"date\":\"desc\"},\"select\":[\"Id\",\"code\",\"rate\",\"date\"]}}");

            var httpClientService = new Mock <IHttpClientService>();

            httpClientService
            .Setup(x => x.GetAsync(It.IsAny <string>()))
            .ReturnsAsync(httpResponseMessage);

            var serviceProviderMock = new Mock <IServiceProvider>();

            serviceProviderMock
            .Setup(x => x.GetService(typeof(IHttpClientService)))
            .Returns(httpClientService.Object);

            ServiceProvider = serviceProviderMock.Object;

            var garmentPurchaseRequestFacade   = new GarmentPurchaseRequestFacade(_dbContext(testName));
            var garmentPurchaseRequestDataUtil = new GarmentPurchaseRequestDataUtil(garmentPurchaseRequestFacade);

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

            var garmentExternalPurchaseOrderFacade   = new GarmentExternalPurchaseOrderFacade(ServiceProvider, _dbContext(testName));
            var garmentExternalPurchaseOrderDataUtil = new GarmentExternalPurchaseOrderDataUtil(garmentExternalPurchaseOrderFacade, garmentInternalPurchaseOrderDataUtil);

            var garmentDeliveryOrderFacade   = new GarmentDeliveryOrderFacade(ServiceProvider, _dbContext(testName));
            var garmentDeliveryOrderDataUtil = new GarmentDeliveryOrderDataUtil(garmentDeliveryOrderFacade, garmentExternalPurchaseOrderDataUtil);

            return(new GarmentCorrectionNoteDataUtil(facade, garmentDeliveryOrderDataUtil));
        }
        private GarmentInternalPurchaseOrderDataUtil dataUtil(GarmentInternalPurchaseOrderFacade facade, string testName)
        {
            var garmentPurchaseRequestFacade   = new GarmentPurchaseRequestFacade(_dbContext(testName));
            var garmentPurchaseRequestDataUtil = new GarmentPurchaseRequestDataUtil(garmentPurchaseRequestFacade);

            return(new GarmentInternalPurchaseOrderDataUtil(facade, garmentPurchaseRequestDataUtil));
        }
        public async void Should_Success_Get_Excel_No_DeliveryOrders()
        {
            var mockServiceProvider = GetMockServiceProvider();

            var dbContext = GetDbContext(GetCurrentMethod());

            var garmentPurchaseRequestFacade   = new GarmentPurchaseRequestFacade(mockServiceProvider.Object, dbContext);
            var garmentPurchaseRequestDataUtil = new GarmentPurchaseRequestDataUtil(garmentPurchaseRequestFacade);
            var garmentPurchaseRequestData     = garmentPurchaseRequestDataUtil.GetNewData();

            var garmentInternalPurchaseOrderFacade   = new GarmentInternalPurchaseOrderFacade(dbContext);
            var garmentInternalPurchaseOrderDataUtil = new GarmentInternalPurchaseOrderDataUtil(garmentInternalPurchaseOrderFacade, garmentPurchaseRequestDataUtil);
            var garmentInternalPurchaseOrderData     = await garmentInternalPurchaseOrderDataUtil.GetNewData(garmentPurchaseRequestData);

            var garmentExternalPurchaseOrderFacade   = new GarmentExternalPurchaseOrderFacade(mockServiceProvider.Object, dbContext);
            var garmentExternalPurchaseOrderDataUtil = new GarmentExternalPurchaseOrderDataUtil(garmentExternalPurchaseOrderFacade, garmentInternalPurchaseOrderDataUtil);
            var garmentExternalPurchaseOrderData     = await garmentExternalPurchaseOrderDataUtil.GetDataForDo2(garmentInternalPurchaseOrderData);

            await garmentExternalPurchaseOrderDataUtil.GetTestDataForDo2(garmentExternalPurchaseOrderData);

            var facade = new MonitoringROMasterFacade(mockServiceProvider.Object, dbContext);

            var Response = facade.GetExcel(garmentPurchaseRequestData.Id);

            Assert.NotNull(Response.Item2);
        }
        private GarmentUnitReceiptNoteDataUtil dataUtil(GarmentUnitReceiptNoteFacade facade, string testName)
        {
            var garmentPurchaseRequestFacade   = new GarmentPurchaseRequestFacade(GetServiceProvider(), _dbContext(testName));
            var garmentPurchaseRequestDataUtil = new GarmentPurchaseRequestDataUtil(garmentPurchaseRequestFacade);

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

            var garmentExternalPurchaseOrderFacade   = new GarmentExternalPurchaseOrderFacade(GetServiceProvider(), _dbContext(testName));
            var garmentExternalPurchaseOrderDataUtil = new GarmentExternalPurchaseOrderDataUtil(garmentExternalPurchaseOrderFacade, garmentInternalPurchaseOrderDataUtil);

            var garmentDeliveryOrderFacade   = new GarmentDeliveryOrderFacade(GetServiceProvider(), _dbContext(testName));
            var garmentDeliveryOrderDataUtil = new GarmentDeliveryOrderDataUtil(garmentDeliveryOrderFacade, garmentExternalPurchaseOrderDataUtil);

            var garmentUnitReceiptNoteFacade   = new GarmentUnitReceiptNoteFacade(GetServiceProvider(), _dbContext(testName));
            var garmentUnitReceiptNoteDatautil = new GarmentUnitReceiptNoteDataUtil(garmentUnitReceiptNoteFacade, garmentDeliveryOrderDataUtil, null);

            var garmentUnitDeliveryOrderFacade   = new GarmentUnitDeliveryOrderFacade(_dbContext(testName), GetServiceProvider());
            var garmentUnitDeliveryOrderDatautil = new GarmentUnitDeliveryOrderDataUtil(garmentUnitDeliveryOrderFacade, garmentUnitReceiptNoteDatautil);

            var garmentUENFacade = new GarmentUnitExpenditureNoteFacade(GetServiceProvider(), _dbContext(testName));
            var dataUtilUEN      = new GarmentUnitExpenditureNoteDataUtil(garmentUENFacade, garmentUnitDeliveryOrderDatautil);

            return(new GarmentUnitReceiptNoteDataUtil(facade, garmentDeliveryOrderDataUtil, dataUtilUEN));
        }
        private GarmentDeliveryOrderDataUtil dataUtilDO(GarmentDeliveryOrderFacade facade, string testName)
        {
            var garmentPurchaseRequestFacade   = new GarmentPurchaseRequestFacade(_dbContext(testName));
            var garmentPurchaseRequestDataUtil = new GarmentPurchaseRequestDataUtil(garmentPurchaseRequestFacade);

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

            var garmentExternalPurchaseOrderFacade   = new GarmentExternalPurchaseOrderFacade(ServiceProvider, _dbContext(testName));
            var garmentExternalPurchaseOrderDataUtil = new GarmentExternalPurchaseOrderDataUtil(garmentExternalPurchaseOrderFacade, garmentInternalPurchaseOrderDataUtil);

            return(new GarmentDeliveryOrderDataUtil(facade, garmentExternalPurchaseOrderDataUtil));
        }
예제 #6
0
        private GarmentUnitReceiptNoteDataUtil dataUtil_DOCurrency(GarmentUnitReceiptNoteFacade facade, string testName)
        {
            var garmentPurchaseRequestFacade   = new GarmentPurchaseRequestFacade(GetServiceProvider_DOCurrency(), _dbContext(testName));
            var garmentPurchaseRequestDataUtil = new GarmentPurchaseRequestDataUtil(garmentPurchaseRequestFacade);

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

            var garmentExternalPurchaseOrderFacade   = new GarmentExternalPurchaseOrderFacade(GetServiceProvider_DOCurrency(), _dbContext(testName));
            var garmentExternalPurchaseOrderDataUtil = new GarmentExternalPurchaseOrderDataUtil(garmentExternalPurchaseOrderFacade, garmentInternalPurchaseOrderDataUtil);

            var garmentDeliveryOrderFacade   = new GarmentDeliveryOrderFacade(GetServiceProvider_DOCurrency(), _dbContext(testName));
            var garmentDeliveryOrderDataUtil = new GarmentDeliveryOrderDataUtil(garmentDeliveryOrderFacade, garmentExternalPurchaseOrderDataUtil);

            return(new GarmentUnitReceiptNoteDataUtil(facade, garmentDeliveryOrderDataUtil, null));
        }
예제 #7
0
        private GarmentCorrectionNoteQuantityDataUtil dataUtil(GarmentCorrectionNoteQuantityFacade facade, string testName)
        {
            var garmentPurchaseRequestFacade   = new GarmentPurchaseRequestFacade(_dbContext(testName));
            var garmentPurchaseRequestDataUtil = new GarmentPurchaseRequestDataUtil(garmentPurchaseRequestFacade);

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

            var garmentExternalPurchaseOrderFacade   = new GarmentExternalPurchaseOrderFacade(ServiceProvider, _dbContext(testName));
            var garmentExternalPurchaseOrderDataUtil = new GarmentExternalPurchaseOrderDataUtil(garmentExternalPurchaseOrderFacade, garmentInternalPurchaseOrderDataUtil);

            var garmentDeliveryOrderFacade   = new GarmentDeliveryOrderFacade(GetServiceProvider().Object, _dbContext(testName));
            var garmentDeliveryOrderDataUtil = new GarmentDeliveryOrderDataUtil(garmentDeliveryOrderFacade, garmentExternalPurchaseOrderDataUtil);

            return(new GarmentCorrectionNoteQuantityDataUtil(facade, garmentDeliveryOrderDataUtil));
        }
        private GarmentUnitReceiptNoteDataUtil garmentUnitReceiptNoteDataUtil(GarmentUnitReceiptNoteFacade garmentUnitReceiptNoteFacade, string testName)
        {
            var garmentPurchaseRequestFacade   = new GarmentPurchaseRequestFacade(GetServiceProvider().Object, _dbContext(testName));
            var garmentPurchaseRequestDataUtil = new GarmentPurchaseRequestDataUtil(garmentPurchaseRequestFacade);

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

            var garmentExternalPurchaseOrderFacade   = new GarmentExternalPurchaseOrderFacade(GetServiceProvider().Object, _dbContext(testName));
            var garmentExternalPurchaseOrderDataUtil = new GarmentExternalPurchaseOrderDataUtil(garmentExternalPurchaseOrderFacade, garmentInternalPurchaseOrderDataUtil);

            var garmentDeliveryOrderFacade   = new GarmentDeliveryOrderFacade(GetServiceProvider().Object, _dbContext(testName));
            var garmentDeliveryOrderDataUtil = new GarmentDeliveryOrderDataUtil(garmentDeliveryOrderFacade, garmentExternalPurchaseOrderDataUtil);

            return(new GarmentUnitReceiptNoteDataUtil(garmentUnitReceiptNoteFacade, garmentDeliveryOrderDataUtil));
        }
        public async void Should_Success_Get_Excel_Empty()
        {
            var mockServiceProvider = GetMockServiceProvider();

            var dbContext = GetDbContext(GetCurrentMethod());

            var garmentPurchaseRequestFacade   = new GarmentPurchaseRequestFacade(mockServiceProvider.Object, dbContext);
            var garmentPurchaseRequestDataUtil = new GarmentPurchaseRequestDataUtil(garmentPurchaseRequestFacade);
            var garmentPurchaseRequestData     = await garmentPurchaseRequestDataUtil.GetTestData();

            var facade = new MonitoringROMasterFacade(mockServiceProvider.Object, dbContext);

            var Response = facade.GetExcel(garmentPurchaseRequestData.Id);

            Assert.NotNull(Response.Item2);
        }
예제 #10
0
        private BasicDataUtil dataUtil(GarmentPOMasterDistributionFacade facade, PurchasingDbContext dbContext)
        {
            var mockServiceProvider            = GetMockServiceProvider();
            var garmentPurchaseRequestFacade   = new GarmentPurchaseRequestFacade(mockServiceProvider.Object, dbContext);
            var garmentPurchaseRequestDataUtil = new GarmentPurchaseRequestDataUtil(garmentPurchaseRequestFacade);

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

            var garmentExternalPurchaseOrderFacade   = new GarmentExternalPurchaseOrderFacade(mockServiceProvider.Object, dbContext);
            var garmentExternalPurchaseOrderDataUtil = new GarmentExternalPurchaseOrderDataUtil(garmentExternalPurchaseOrderFacade, garmentInternalPurchaseOrderDataUtil);

            var garmentDeliveryOrderFacade   = new GarmentDeliveryOrderFacade(mockServiceProvider.Object, dbContext);
            var garmentDeliveryOrderDataUtil = new GarmentDeliveryOrderDataUtil(garmentDeliveryOrderFacade, garmentExternalPurchaseOrderDataUtil);

            return(new BasicDataUtil(facade, garmentDeliveryOrderDataUtil));
        }
예제 #11
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));
        }
        private GarmentInvoiceDataUtil dataUtil(GarmentInvoiceFacade facade, string testName)
        {
            var garmentInvoiceFacade           = new GarmentInvoiceFacade(_dbContext(testName), ServiceProvider);
            var garmentInvoiceDetailDataUtil   = new GarmentInvoiceDetailDataUtil();
            var garmentInvoiceItemDataUtil     = new GarmentInvoiceItemDataUtil(garmentInvoiceDetailDataUtil);
            var garmentDeliveryOrderFacade     = new GarmentDeliveryOrderFacade(GetServiceProvider().Object, _dbContext(testName));
            var garmentPurchaseRequestFacade   = new GarmentPurchaseRequestFacade(_dbContext(testName));
            var garmentPurchaseRequestDataUtil = new GarmentPurchaseRequestDataUtil(garmentPurchaseRequestFacade);

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

            var garmentExternalPurchaseOrderFacade   = new GarmentExternalPurchaseOrderFacade(ServiceProvider, _dbContext(testName));
            var garmentExternalPurchaseOrderDataUtil = new GarmentExternalPurchaseOrderDataUtil(garmentExternalPurchaseOrderFacade, garmentInternalPurchaseOrderDataUtil);

            var garmentDeliveryOrderDataUtil = new GarmentDeliveryOrderDataUtil(garmentDeliveryOrderFacade, garmentExternalPurchaseOrderDataUtil);

            return(new GarmentInvoiceDataUtil(garmentInvoiceItemDataUtil, garmentInvoiceDetailDataUtil, garmentDeliveryOrderDataUtil, facade));
        }
        private async Task <DataUtilResult> GetDataUtil(GarmentPOMasterDistributionFacade facade, PurchasingDbContext dbContext)
        {
            var mockServiceProvider            = GetMockServiceProvider();
            var garmentPurchaseRequestFacade   = new GarmentPurchaseRequestFacade(mockServiceProvider.Object, dbContext);
            var garmentPurchaseRequestDataUtil = new GarmentPurchaseRequestDataUtil(garmentPurchaseRequestFacade);
            var garmentPurchaseRequestData     = garmentPurchaseRequestDataUtil.GetNewData();

            var garmentInternalPurchaseOrderFacade   = new GarmentInternalPurchaseOrderFacade(dbContext);
            var garmentInternalPurchaseOrderDataUtil = new GarmentInternalPurchaseOrderDataUtil(garmentInternalPurchaseOrderFacade, garmentPurchaseRequestDataUtil);
            var garmentInternalPurchaseOrderData     = await garmentInternalPurchaseOrderDataUtil.GetNewData(garmentPurchaseRequestData);

            var garmentExternalPurchaseOrderFacade   = new GarmentExternalPurchaseOrderFacade(mockServiceProvider.Object, dbContext);
            var garmentExternalPurchaseOrderDataUtil = new GarmentExternalPurchaseOrderDataUtil(garmentExternalPurchaseOrderFacade, garmentInternalPurchaseOrderDataUtil);
            var garmentExternalPurchaseOrderData     = await garmentExternalPurchaseOrderDataUtil.GetDataForDo2(garmentInternalPurchaseOrderData);

            var garmentDeliveryOrderFacade   = new GarmentDeliveryOrderFacade(mockServiceProvider.Object, dbContext);
            var garmentDeliveryOrderDataUtil = new GarmentDeliveryOrderDataUtil(garmentDeliveryOrderFacade, garmentExternalPurchaseOrderDataUtil);
            var garmentDeliveryOrderData     = await garmentDeliveryOrderDataUtil.GetNewData4(garmentExternalPurchaseOrderData);

            return(new DataUtilResult(new BasicDataUtil(facade, garmentDeliveryOrderDataUtil), garmentPurchaseRequestData, garmentInternalPurchaseOrderData, garmentExternalPurchaseOrderData, garmentDeliveryOrderData));
        }
예제 #14
0
        public async Task ShouldSuccess_ReadSPB_NonGarment()
        {
            //Setup
            PurchasingDbContext dbContext = GetDbContext(GetCurrentAsyncMethod());
            var serviceProviderMock       = GetServiceProvider();

            GarmentExternalPurchaseOrderFacade facade = new GarmentExternalPurchaseOrderFacade(serviceProviderMock.Object, dbContext);
            GarmentPurchaseRequestFacade       garmentPurchaseRequestFacade   = new GarmentPurchaseRequestFacade(serviceProviderMock.Object, dbContext);
            GarmentPurchaseRequestDataUtil     garmentPurchaseRequestDataUtil = new GarmentPurchaseRequestDataUtil(garmentPurchaseRequestFacade);

            GarmentInternalPurchaseOrderFacade   internalPurchaseOrderFacade  = new GarmentInternalPurchaseOrderFacade(dbContext);
            GarmentInternalPurchaseOrderDataUtil garmentPurchaseOrderDataUtil = new GarmentInternalPurchaseOrderDataUtil(internalPurchaseOrderFacade, garmentPurchaseRequestDataUtil);

            var data = await _dataUtil(facade, garmentPurchaseOrderDataUtil).GetTestData_VBRequestPOExternal();

            //Act
            VBRequestPOExternalService service = new VBRequestPOExternalService(dbContext, serviceProviderMock.Object);
            var result = service.ReadSPB("P", "NON_GARMENT", new List <long>(), "IDR", "UMUM");

            //Assert
            Assert.NotNull(result);
        }
예제 #15
0
        public async Task ReadPOExternal_with_Garment_Return_Success()
        {
            //Setup
            PurchasingDbContext dbContext = GetDbContext(GetCurrentAsyncMethod());
            var serviceProviderMock       = GetServiceProvider();

            GarmentExternalPurchaseOrderFacade facade = new GarmentExternalPurchaseOrderFacade(serviceProviderMock.Object, dbContext);
            GarmentPurchaseRequestFacade       garmentPurchaseRequestFacade   = new GarmentPurchaseRequestFacade(serviceProviderMock.Object, dbContext);
            GarmentPurchaseRequestDataUtil     garmentPurchaseRequestDataUtil = new GarmentPurchaseRequestDataUtil(garmentPurchaseRequestFacade);

            GarmentInternalPurchaseOrderFacade   internalPurchaseOrderFacade  = new GarmentInternalPurchaseOrderFacade(dbContext);
            GarmentInternalPurchaseOrderDataUtil garmentPurchaseOrderDataUtil = new GarmentInternalPurchaseOrderDataUtil(internalPurchaseOrderFacade, garmentPurchaseRequestDataUtil);

            var data = await _dataUtil(facade, garmentPurchaseOrderDataUtil).GetTestData_VBRequestPOExternal();

            //Act
            VBRequestPOExternalService service = new VBRequestPOExternalService(dbContext, serviceProviderMock.Object);
            var result = service.ReadPOExternal("PO700100001", "GARMENT", "IDR");

            //Assert
            Assert.NotNull(result);
        }
        public async Task Should_Error_Get_Xls_Payment()
        {
            var httpClientService = new Mock <IHttpClientService>();

            httpClientService.Setup(x => x.GetAsync(It.Is <string>(s => s.Contains("master/garment-suppliers"))))
            .ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK)
            {
                Content = new StringContent(new SupplierDataUtil().GetResultFormatterOkString())
            });
            httpClientService
            .Setup(x => x.GetAsync(It.Is <string>(s => s.Contains("master/garment-currencies"))))
            .ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK)
            {
                Content = new StringContent(new CurrencyDataUtil().GetMultipleResultFormatterOkString())
            });

            var serviceProviderMock = new Mock <IServiceProvider>();

            serviceProviderMock
            .Setup(x => x.GetService(typeof(IdentityService)))
            .Returns(new IdentityService {
                Username = "******", TimezoneOffset = 7
            });
            serviceProviderMock
            .Setup(x => x.GetService(typeof(IHttpClientService)))
            .Returns(httpClientService.Object);
            var dbContext = _dbContext(GetCurrentMethod());
            //var serviceProvider = GetServiceProvider().Object;

            var facade = new GarmentInternNoteFacades(dbContext, serviceProviderMock.Object);
            var garmentcorrectionfacade            = new Lib.Facades.GarmentCorrectionNoteFacades.GarmentCorrectionNotePriceFacade(serviceProviderMock.Object, dbContext);
            var garmentPurchaseRequestFacade       = new GarmentPurchaseRequestFacade(serviceProviderMock.Object, dbContext);
            var garmentInternalPurchaseOrderFacade = new GarmentInternalPurchaseOrderFacade(dbContext);
            var garmentExternalPurchaseOrderFacade = new GarmentExternalPurchaseOrderFacade(serviceProviderMock.Object, dbContext);
            var garmentDeliveryOrderFacade         = new GarmentDeliveryOrderFacade(serviceProviderMock.Object, dbContext);
            var garmentInvoiceFacade         = new GarmentInvoiceFacade(dbContext, serviceProviderMock.Object);
            var prdatautil                   = new GarmentPurchaseRequestDataUtil(garmentPurchaseRequestFacade);
            var internalPoDatautil           = new GarmentInternalPurchaseOrderDataUtil(garmentInternalPurchaseOrderFacade, prdatautil);
            var datautilexpo                 = new GarmentExternalPurchaseOrderDataUtil(garmentExternalPurchaseOrderFacade, internalPoDatautil);
            var dataUtilDo                   = new GarmentDeliveryOrderDataUtil(garmentDeliveryOrderFacade, datautilexpo);
            var garmentInvoiceDetailDataUtil = new GarmentInvoiceDetailDataUtil();
            var garmentInvoiceItemDataUtil   = new GarmentInvoiceItemDataUtil(garmentInvoiceDetailDataUtil);
            var garmentInvoieDataUtil        = new GarmentInvoiceDataUtil(garmentInvoiceItemDataUtil, garmentInvoiceDetailDataUtil, dataUtilDo, garmentInvoiceFacade);
            var corecctiondatautil           = new GarmentCorrectionNoteDataUtil(garmentcorrectionfacade, dataUtilDo);

            var dataDo = await dataUtilDo.GetTestData();

            var dataCorr = await corecctiondatautil.GetTestData(dataDo);

            var invoData = await garmentInvoieDataUtil.GetTestData2("Test", dataDo);

            var dataIntern = await dataUtil(facade, GetCurrentMethod()).GetNewData(invoData);

            dataIntern.Items.FirstOrDefault().Details.FirstOrDefault().PaymentDueDate = DateTimeOffset.Now;
            await facade.Create(dataIntern, false, "Unit Test");

            DataTable dataTable = new DataTable();

            dataTable.Columns.Add("Nomor", typeof(string));
            dataTable.Columns.Add("Tgl", typeof(DateTime));
            dataTable.Columns.Add("Jumlah", typeof(decimal));
            dataTable.Rows.Add("Nomor", "1970,1,1", 0);

            Mock <ILocalDbCashFlowDbContext> mockDbContext = new Mock <ILocalDbCashFlowDbContext>();

            mockDbContext.Setup(s => s.ExecuteReaderOnlyQuery(It.IsAny <string>()))
            .Throws(new Exception("Error ExecuteReader"));
            mockDbContext.Setup(s => s.ExecuteReader(It.IsAny <string>(), It.IsAny <List <SqlParameter> >()))
            .Throws(new Exception("Error ExecuteReader"));

            var facadepaymentstatus = new GarmentInternNotePaymentStatusFacade(serviceProviderMock.Object, dbContext, mockDbContext.Object);
            var Response            = Assert.ThrowsAny <Exception>(() => facadepaymentstatus.GetXLs(null, null, null, null, null, null, null, null, DateTime.Now.AddDays(1), null, DateTime.Now.AddDays(1), null, 7));

            Assert.NotNull(Response);
        }
 public GarmentInternalPurchaseOrderDataUtil(GarmentInternalPurchaseOrderFacade facade, GarmentPurchaseRequestDataUtil garmentPurchaseRequestDataUtil)
 {
     this.facade = facade;
     this.garmentPurchaseRequestDataUtil = garmentPurchaseRequestDataUtil;
 }