コード例 #1
0
        public void Validate_DefaultValue()
        {
            GarmentShippingLocalSalesNoteViewModel viewModel = new GarmentShippingLocalSalesNoteViewModel();

            var result = viewModel.Validate(null);

            Assert.NotEmpty(result.ToList());
        }
コード例 #2
0
        public void Validate_EmptyValue()
        {
            GarmentShippingLocalSalesNoteViewModel viewModel = new GarmentShippingLocalSalesNoteViewModel
            {
                date            = DateTimeOffset.MinValue,
                transactionType = new TransactionType {
                    id = 0
                },
                buyer = new Buyer {
                    Id = 0
                },
                tempo       = 0,
                paymentType = "TEMPO"
            };

            var result = viewModel.Validate(null);

            Assert.NotEmpty(result.ToList());
        }
コード例 #3
0
        public void Validate_ItemsEmptyValue()
        {
            GarmentShippingLocalSalesNoteViewModel viewModel = new GarmentShippingLocalSalesNoteViewModel();

            viewModel.items = new List <GarmentShippingLocalSalesNoteItemViewModel>
            {
                new GarmentShippingLocalSalesNoteItemViewModel
                {
                    product = new ProductViewModel {
                        id = 0
                    },
                    uom = new UnitOfMeasurement {
                        Id = 0
                    }
                }
            };

            var result = viewModel.Validate(null);

            Assert.NotEmpty(result.ToList());
        }