Example #1
0
        public void Should_Success_Instantiate()
        {
            var productionOrder = new ProductionOrderIntegrationViewModel();
            var item            = new List <ShipmentDocumentItemViewModel>()
            {
                new ShipmentDocumentItemViewModel()
            };

            ShipmentDocumentDetailViewModel viewModel = new ShipmentDocumentDetailViewModel()
            {
                ProductionOrderColorType    = "ProductionOrderColorType",
                ProductionOrderDesignCode   = "ProductionOrderDesignCode",
                ProductionOrderDesignNumber = "ProductionOrderDesignNumber",
                ProductionOrderId           = 1,
                ProductionOrderType         = "ProductionOrderType",
                ProductionOrderNo           = "ProductionOrderNo",
                ProductionOrder             = productionOrder,
                Items = item
            };

            Assert.Equal("ProductionOrderColorType", viewModel.ProductionOrderColorType);
            Assert.Equal("ProductionOrderDesignCode", viewModel.ProductionOrderDesignCode);
            Assert.Equal("ProductionOrderDesignNumber", viewModel.ProductionOrderDesignNumber);
            Assert.Equal(1, viewModel.ProductionOrderId);
            Assert.Equal("ProductionOrderNo", viewModel.ProductionOrderNo);
            Assert.Equal(productionOrder, viewModel.ProductionOrder);
            Assert.Equal("ProductionOrderType", viewModel.ProductionOrderType);
            Assert.Equal(item, viewModel.Items);
        }
        public void Should_Success_Instantiate()
        {
            var time    = DateTimeOffset.Now;
            var details = new List <MonitoringSpecificationMachineDetailsViewModel>()
            {
                new MonitoringSpecificationMachineDetailsViewModel()
            };
            var machine         = new MachineViewModel();
            var productionOrder = new ProductionOrderIntegrationViewModel();
            MonitoringSpecificationMachineViewModel viewModel = new MonitoringSpecificationMachineViewModel()
            {
                UId             = "UId",
                Code            = "Code",
                CartNumber      = "CartNumber",
                DateTimeInput   = time,
                Machine         = machine,
                Details         = details,
                ProductionOrder = productionOrder,
            };

            Assert.Equal("UId", viewModel.UId);
            Assert.Equal("Code", viewModel.Code);
            Assert.Equal("CartNumber", viewModel.CartNumber);
            Assert.Equal(machine, viewModel.Machine);
            Assert.Equal(details, viewModel.Details);
            Assert.Equal(time, viewModel.DateTimeInput);
            Assert.Equal(productionOrder, viewModel.ProductionOrder);
        }
        public void Should_Success_Instantiate()
        {
            var carts = new List <CartViewModel>()
            {
                new CartViewModel()
                {
                    Code       = "Code",
                    CartNumber = "CartNumber",
                    Pcs        = 1,
                    Qty        = 1,
                    Uom        = new UOMIntegrationViewModel()
                    {
                        Unit = "Unit"
                    }
                }
            };



            var instruction     = new KanbanInstructionViewModel();
            var productionOrder = new ProductionOrderIntegrationViewModel();
            var selectedProductionOrderDetail = new ProductionOrderDetailIntegrationViewModel();
            KanbanCreateViewModel viewModel   = new KanbanCreateViewModel()
            {
                GoodOutput      = 1,
                BadOutput       = 1,
                Code            = "Code",
                Carts           = carts,
                CurrentQty      = 1,
                Instruction     = instruction,
                IsBadOutput     = true,
                Grade           = "Grade",
                IsComplete      = true,
                IsInactive      = false,
                IsReprocess     = true,
                OldKanbanId     = 1,
                ProductionOrder = productionOrder,
                SelectedProductionOrderDetail = selectedProductionOrderDetail,
                CurrentStepIndex = 1
            };

            Assert.Equal(1, viewModel.BadOutput);
            Assert.Equal("Code", viewModel.Code);
            Assert.Equal(carts, viewModel.Carts);
            Assert.Equal("Code", viewModel.Code);
            Assert.Equal(1, viewModel.CurrentQty);
            Assert.Equal(1, viewModel.CurrentStepIndex);
            Assert.Equal(1, viewModel.GoodOutput);
            Assert.Equal("Grade", viewModel.Grade);
            Assert.Equal(instruction, viewModel.Instruction);
            Assert.True(viewModel.IsBadOutput);
            Assert.True(viewModel.IsComplete);
            Assert.False(viewModel.IsInactive);
            Assert.True(viewModel.IsReprocess);
            Assert.Equal("Grade", viewModel.Grade);
            Assert.Equal(selectedProductionOrderDetail, viewModel.SelectedProductionOrderDetail);
        }
        public void should_succes_instantiate()
        {
            ProductionOrderIntegrationViewModel viewModel = new ProductionOrderIntegrationViewModel()
            {
                OrderQuantity       = 1,
                IsCompleted         = true,
                DistributedQuantity = 1,
                OrderType           = new OrderTypeIntegrationViewModel()
            };

            Assert.Equal(1, viewModel.OrderQuantity);
            Assert.True(viewModel.IsCompleted);
            Assert.Equal(1, viewModel.DistributedQuantity);
            Assert.NotNull(viewModel.OrderType);
        }
Example #5
0
        public void Should_Success_Instantiate()
        {
            var time             = DateTimeOffset.Now;
            var machineViewModel = new MachineViewModel()
            {
                UId  = "UId",
                Code = "Code"
            };
            var production = new ProductionOrderIntegrationViewModel()
            {
            };
            var productionOrderDetail          = new ProductionOrderDetailIntegrationViewModel();
            var machineEvent                   = new MachineEventViewModel();
            MonitoringEventViewModel viewModel = new MonitoringEventViewModel()
            {
                UId                   = "UId",
                CartNumber            = "CartNumber",
                Code                  = "Code",
                DateStart             = time,
                DateEnd               = time,
                TimeInMilisStart      = 1,
                TimeInMilisEnd        = 1,
                Remark                = "Remark",
                Machine               = machineViewModel,
                ProductionOrder       = production,
                ProductionOrderDetail = productionOrderDetail,
                MachineEvent          = machineEvent,
            };

            Assert.Equal("UId", viewModel.UId);
            Assert.Equal("CartNumber", viewModel.CartNumber);
            Assert.Equal("Code", viewModel.Code);
            Assert.Equal(time, viewModel.DateStart);
            Assert.Equal(time, viewModel.DateEnd);
            Assert.Equal(1, viewModel.TimeInMilisStart);
            Assert.Equal(1, viewModel.TimeInMilisEnd);
            Assert.Equal("Remark", viewModel.Remark);
            Assert.Equal("Remark", viewModel.Remark);
            Assert.Equal(machineViewModel, viewModel.Machine);
            Assert.Equal(production, viewModel.ProductionOrder);
            Assert.Equal(productionOrderDetail, viewModel.ProductionOrderDetail);
            Assert.Equal(machineEvent, viewModel.MachineEvent);
        }
Example #6
0
        public void Should_Success_Instantiate()
        {
            var account      = new AccountIntegrationViewModel();
            var buyer        = new BuyerIntegrationViewModel();
            var time         = DateTimeOffset.Now;
            var designMotive = new DesignMotiveIntegrationViewModel();
            var details      = new List <ProductionOrderDetailIntegrationViewModel>()
            {
                new ProductionOrderDetailIntegrationViewModel()
            };
            var finishType    = new FinishTypeIntegrationViewModel();
            var lampStandards = new List <ProductionLampStandardIntegrationViewModel>()
            {
                new ProductionLampStandardIntegrationViewModel()
            };

            var material             = new MaterialIntegrationViewModel();
            var materialConstruction = new MaterialConstructionIntegrationViewModel();
            var orderType            = new OrderTypeIntegrationViewModel();
            var processType          = new ProcessTypeIntegrationViewModel();
            var runWidths            = new List <ProductionRunWidthIntegrationViewModel>()
            {
                new ProductionRunWidthIntegrationViewModel()
            };
            var standardTests = new StandardTestIntegrationViewModel();
            var uom           = new UOMIntegrationViewModel();
            var yarnMaterial  = new YarnMaterialIntegrationViewModel();
            ProductionOrderIntegrationViewModel viewModel = new ProductionOrderIntegrationViewModel()
            {
                Account           = account,
                ArticleFabricEdge = "ArticleFabricEdge",
                Buyer             = buyer,
                Code                 = "Code",
                DeliveryDate         = time,
                DesignCode           = "DesignCode",
                DesignMotive         = designMotive,
                DesignNumber         = "DesignNumber",
                Details              = details,
                DistributedQuantity  = 1,
                FinishType           = finishType,
                IsClosed             = true,
                IsCompleted          = true,
                IsRequested          = true,
                IsUsed               = true,
                LampStandards        = lampStandards,
                Material             = material,
                MaterialConstruction = materialConstruction,
                MaterialOrigin       = "MaterialOrigin",
                MaterialWidth        = "MaterialWidth",
                OrderNo              = "OrderNo",
                OrderQuantity        = 1,
                OrderType            = orderType,
                PackingInstruction   = "PackingInstruction",
                ProcessType          = processType,
                Remark               = "Remark",
                Run                       = "Run",
                RunWidths                 = runWidths,
                SalesContractNo           = "SalesContractNo",
                ShippingQuantityTolerance = 1,
                Sample                    = "Sample",
                ShrinkageStandard         = "ShrinkageStandard",
                StandardTests             = standardTests,
                Uom                       = uom,
                YarnMaterial              = yarnMaterial
            };

            Assert.Equal(account, viewModel.Account);
            Assert.Equal("ArticleFabricEdge", viewModel.ArticleFabricEdge);
            Assert.Equal(buyer, viewModel.Buyer);
            Assert.Equal("Code", viewModel.Code);
            Assert.Equal(time, viewModel.DeliveryDate);
            Assert.Equal("DesignCode", viewModel.DesignCode);
            Assert.Equal(designMotive, viewModel.DesignMotive);
            Assert.Equal("DesignNumber", viewModel.DesignNumber);
            Assert.Equal(details, viewModel.Details);
            Assert.Equal(1, viewModel.DistributedQuantity);
            Assert.Equal(finishType, viewModel.FinishType);
            Assert.True(viewModel.IsClosed);
            Assert.True(viewModel.IsCompleted);
            Assert.True(viewModel.IsRequested);
            Assert.True(viewModel.IsUsed);
            Assert.Equal(lampStandards, viewModel.LampStandards);
            Assert.Equal(materialConstruction, viewModel.MaterialConstruction);
            Assert.Equal("MaterialOrigin", viewModel.MaterialOrigin);
            Assert.Equal("MaterialWidth", viewModel.MaterialWidth);
            Assert.Equal(1, viewModel.OrderQuantity);
            Assert.Equal("OrderNo", viewModel.OrderNo);
            Assert.Equal("PackingInstruction", viewModel.PackingInstruction);
            Assert.Equal(orderType, viewModel.OrderType);
            Assert.Equal(processType, viewModel.ProcessType);
            Assert.Equal("Remark", viewModel.Remark);
            Assert.Equal("Run", viewModel.Run);
            Assert.Equal(runWidths, viewModel.RunWidths);
            Assert.Equal("SalesContractNo", viewModel.SalesContractNo);
            Assert.Equal("Sample", viewModel.Sample);
            Assert.Equal(1, viewModel.ShippingQuantityTolerance);
            Assert.Equal("ShrinkageStandard", viewModel.ShrinkageStandard);
            Assert.Equal(standardTests, viewModel.StandardTests);
            Assert.Equal(uom, viewModel.Uom);
            Assert.Equal(yarnMaterial, viewModel.YarnMaterial);
        }