public async Task Should_Success_MapToViewModel()
        {
            InventoryWeavingDocumentOutService service = new InventoryWeavingDocumentOutService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));

            List <InventoryWeavingUploadCsvOutViewModel> CSV = new List <InventoryWeavingUploadCsvOutViewModel>
            {
                new InventoryWeavingUploadCsvOutViewModel
                {
                    ReferenceNo       = "",
                    ProductionOrderNo = "",
                    Construction      = "CD",
                    MaterialName      = "CD",
                    WovenType         = "a",
                    Piece             = "1",
                    Width             = "1",
                    Yarn1             = "yarn1",
                    Yarn2             = "yarn2",
                    YarnType1         = "yt1",
                    YarnType2         = "yt2",
                    YarnOrigin1       = "yo1",
                    YarnOrigin2       = "yo2",
                    Grade             = "a",
                    Qty      = "1",
                    QtyPiece = "1",
                    //Barcode = "barcode",
                    //ProductionOrderDate = DateTime.Now,
                }
            };

            var Response = service.MapToViewModel(CSV, DateTime.Now);

            Assert.NotNull(Response);
        }
        public void Should_Success_CheckCsv()
        {
            InventoryWeavingDocumentOutService service = new InventoryWeavingDocumentOutService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));

            List <InventoryWeavingDocumentOutItemViewModel> CSV = new List <InventoryWeavingDocumentOutItemViewModel>
            {
                new InventoryWeavingDocumentOutItemViewModel
                {
                    ReferenceNo   = "referencce",
                    Construction  = "CD",
                    Grade         = "a",
                    Piece         = "1",
                    MaterialName  = "CD",
                    WovenType     = "a",
                    Yarn1         = "yarn1",
                    Yarn2         = "yarn2",
                    YarnType1     = "yt1",
                    YarnType2     = "yt2",
                    YarnOrigin1   = "yo1",
                    YarnOrigin2   = "yo2",
                    Width         = "1",
                    Quantity      = 1,
                    QuantityPiece = 1,
                    //Barcode = "barcode",
                    //ProductionOrderDate = DateTime.Now,

                    ProductOrderNo  = "a",
                    DestinationArea = "a",
                    Type            = "IN"
                }
            };

            var response = service.checkCsv(CSV);
        }
        public async void GetQueryReport()
        {
            InventoryWeavingDocumentOutService service = new InventoryWeavingDocumentOutService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));

            var data     = _dataUtilDoc(service).GetQueryReport();
            var response = service.GetQueryReport("", null, null, 7);

            Assert.NotNull(response);
        }
        public async Task Should_Success_MapToModelUpload()
        {
            InventoryWeavingDocumentOutService service = new InventoryWeavingDocumentOutService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));

            var data     = _dataUtilDoc(service).GetNewData2();
            var Response = await service.MapToModelUpload(data);

            Assert.NotNull(Response);
        }
        public async void Should_Success_GetMaterial()
        {
            InventoryWeavingDocumentOutService service = new InventoryWeavingDocumentOutService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));

            var data     = _dataUtilDoc(service).GetMaterialList();
            var Response = service.GetMaterialItemList("{}");

            Assert.NotNull(Response);
        }
        public async Task Create_Success_Upload()
        {
            InventoryWeavingDocumentOutService service = new InventoryWeavingDocumentOutService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));

            var data = _dataUtilDoc(service).GetNewData();

            var Response = service.UploadData(data, "test");

            Assert.NotNull(Response);
        }
        public async Task Should_Success_Read()
        {
            InventoryWeavingDocumentOutService service = new InventoryWeavingDocumentOutService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));

            var data = _dataUtilDoc(service).GetTestData();

            var Response = service.Read(1, 25, "{}", "", "");

            Assert.NotNull(Response);
        }
        public async Task Should_Success_MapToModel()
        {
            InventoryWeavingDocumentAdjService serviceAdj = new InventoryWeavingDocumentAdjService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));
            InventoryWeavingDocumentOutService serviceOut = new InventoryWeavingDocumentOutService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));

            var data = _dataUtilDocOut(serviceOut).GetCSVDownloadOut();

            var Response = serviceAdj.MapToModel(data);

            Assert.NotNull(Response);
        }
        public void Should_success_GetCsv()
        {
            InventoryWeavingDocumentOutService service = new InventoryWeavingDocumentOutService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));

            var dataDoc = _dataUtilDoc(service).GetTestData();
            //var Responses =  Utilservice.Create(data);

            // var Service = new ReportGreigeWeavingPerGradeService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));
            var Response = service.DownloadCSVOut(DateTime.Now, DateTime.Now, 7, null);

            Assert.IsType <System.IO.MemoryStream>(Response);
        }
        public async void Should_Error_UploadValidate()
        {
            InventoryWeavingDocumentOutService service = new InventoryWeavingDocumentOutService(GetServiceProvider().Object, _dbContext(GetCurrentMethod()));

            List <InventoryWeavingUploadCsvOutViewModel> CSV = new List <InventoryWeavingUploadCsvOutViewModel>
            {
                new InventoryWeavingUploadCsvOutViewModel
                {
                    ReferenceNo       = "",
                    Construction      = "",
                    MaterialName      = "",
                    WovenType         = "",
                    Width             = "",
                    Yarn1             = "",
                    Yarn2             = "",
                    YarnType1         = "",
                    YarnType2         = "",
                    YarnOrigin1       = "",
                    YarnOrigin2       = "",
                    ProductionOrderNo = "",
                    Grade             = "",
                    Piece             = "",
                    Qty      = "",
                    QtyPiece = "",

                    //Barcode = "",

                    //ProductionOrderDate = Convert.ToDateTime(""),
                }
            };

            List <KeyValuePair <string, StringValues> > body     = new List <KeyValuePair <string, StringValues> >();
            KeyValuePair <string, StringValues>         keyValue = new KeyValuePair <string, StringValues>("date", "2020-01-10");

            body.Add(keyValue);

            var Response = service.UploadValidate(ref CSV, body);

            Assert.NotNull(Response);
        }
 private InventoryWeavingDocumentOutDataUtil _dataUtilDoc(InventoryWeavingDocumentOutService service)
 {
     GetServiceProvider();
     return(new InventoryWeavingDocumentOutDataUtil(service));
 }
Exemplo n.º 12
0
 public InventoryWeavingDocumentOutDataUtil(InventoryWeavingDocumentOutService service)
 {
     Service = service;
 }