Beispiel #1
0
        public void Should_Success_Validate_Data()
        {
            GarmentExternalPurchaseOrderViewModel nullViewModel = new GarmentExternalPurchaseOrderViewModel();

            Assert.True(nullViewModel.Validate(null).Count() > 0);

            GarmentExternalPurchaseOrderViewModel viewModel = new GarmentExternalPurchaseOrderViewModel
            {
                Category = "FABRIC",
                Supplier = new SupplierViewModel(),
                IsUseVat = true,
                Vat      = new VatViewModel()
                {
                    Id   = 0,
                    Rate = 0
                },
                Items = new List <GarmentExternalPurchaseOrderItemViewModel>
                {
                    new GarmentExternalPurchaseOrderItemViewModel(),
                    new GarmentExternalPurchaseOrderItemViewModel
                    {
                        Product  = new GarmentProductViewModel(),
                        DealUom  = new UomViewModel(),
                        SmallUom = new UomViewModel(),

                        PRId             = 0,
                        PONo             = null,
                        DefaultQuantity  = 0,
                        DefaultUom       = null,
                        SmallQuantity    = 0,
                        UsedBudget       = 0,
                        DOQuantity       = 0,
                        OverBudgetRemark = null,
                        UENItemId        = null
                    }
                },

                UENId      = null,
                BudgetRate = 0
            };

            Assert.True(viewModel.Validate(null).Count() > 0);
        }
        public void Should_Success_Validate_Data()
        {
            GarmentExternalPurchaseOrderViewModel nullViewModel = new GarmentExternalPurchaseOrderViewModel();

            Assert.True(nullViewModel.Validate(null).Count() > 0);

            GarmentExternalPurchaseOrderViewModel viewModel = new GarmentExternalPurchaseOrderViewModel
            {
                Category = "FABRIC",
                Supplier = new SupplierViewModel(),
                Items    = new List <GarmentExternalPurchaseOrderItemViewModel>
                {
                    new GarmentExternalPurchaseOrderItemViewModel(),
                    new GarmentExternalPurchaseOrderItemViewModel
                    {
                        Product = new GarmentProductViewModel(),
                        DealUom = new UomViewModel(),
                    }
                }
            };

            Assert.True(viewModel.Validate(null).Count() > 0);
        }