Esempio n. 1
0
        public void Should_Success_MapToModel()
        {
            FpReturnFromBuyerService utilService = new FpReturnFromBuyerService(DbContext(GetCurrentMethod()), GetServiceProvider().Object, GetInventoryDocumentService().Object);
            var data = DataUtil(utilService).GetEmptyData();

            var model = utilService.MapToModel(data);

            Assert.NotNull(model);
        }
Esempio n. 2
0
        public void Should_Succes_Map_To_ViewModel()
        {
            var viewModel = new FpReturnFromBuyerViewModel()
            {
                Buyer = new BuyerViewModel()
                {
                    Code = "BuyerCode",
                    Id   = 1,
                    Name = "BuyerName"
                },
                Code        = "Code",
                CodeProduct = "CodeProduct",
                CoverLetter = "CoverLetter",
                Date        = DateTime.Now,
                Destination = "Destination",
                Details     = new List <FpReturnFromBuyerDetailViewModel>()
                {
                    new FpReturnFromBuyerDetailViewModel()
                    {
                        Items = new List <FpReturnFromBuyerItemViewModel>()
                        {
                            new FpReturnFromBuyerItemViewModel()
                            {
                                ColorWay       = "ColorWay",
                                DesignCode     = "DesignCode",
                                DesignNumber   = "DesignNumber",
                                Length         = 1,
                                ProductCode    = "ProductCode",
                                ProductId      = 1,
                                ProductName    = "ProductName",
                                Remark         = "",
                                ReturnQuantity = 1,
                                UOM            = "UOM",
                                UOMId          = 1,
                                Weight         = 1
                            }
                        },
                        ProductionOrder = new ProductionOrderIntegrationViewModel()
                        {
                            DistributedQuantity = 1,
                            IsCompleted         = false,
                            OrderNo             = "OrderNo",
                            Id            = 1,
                            OrderQuantity = 1,
                            OrderType     = new OrderTypeIntegrationViewModel()
                            {
                                Code = "OrderTypeCode",
                                Id   = 1,
                                Name = "OrderTypeName"
                            }
                        }
                    }
                },
                SpkNo   = "SpkNo",
                Storage = new StorageIntegrationViewModel()
                {
                    code = "StorageCode",
                    name = "StorageName",
                    _id  = 1
                }
            };

            FpReturnFromBuyerService service = new FpReturnFromBuyerService(DbContext(GetCurrentMethod()), GetServiceProvider().Object, GetInventoryDocumentService().Object);

            var model = service.MapToModel(viewModel);

            Assert.NotNull(model);
        }