Ejemplo n.º 1
0
        public void Validate_DefaultValue()
        {
            GarmentPackingListViewModel viewModel = ViewModel;

            var result = viewModel.Validate(null);

            Assert.NotEmpty(result.ToList());
        }
        public void Validate_DateMoreThanToday()
        {
            GarmentPackingListViewModel viewModel = ViewModel;

            viewModel.Date         = DateTimeOffset.Now.AddDays(1);
            viewModel.Items        = new List <GarmentPackingListItemViewModel>();
            viewModel.Measurements = new List <GarmentPackingListMeasurementViewModel>();

            var result = viewModel.Validate(null);

            Assert.NotEmpty(result.ToList());
        }
        public void Validate_MeasurementsDefaultValue()
        {
            GarmentPackingListViewModel viewModel = ViewModel;

            viewModel.Measurements = new List <GarmentPackingListMeasurementViewModel>
            {
                new GarmentPackingListMeasurementViewModel()
            };

            var result = viewModel.Validate(null);

            Assert.NotEmpty(result.ToList());
        }
        public void Validate_DefaultValue()
        {
            GarmentPackingListViewModel viewModel = ViewModel;

            foreach (var activity in viewModel.StatusActivities)
            {
                activity.Id           = activity.Id;
                activity.CreatedDate  = activity.CreatedDate;
                activity.CreatedBy    = activity.CreatedBy;
                activity.CreatedAgent = activity.CreatedAgent;
                activity.Remark       = activity.Remark;
                activity.Status       = activity.Status;
            }

            var result = viewModel.Validate(null);

            Assert.NotEmpty(result.ToList());
        }
        public void Validate_DetailsDefaultValue()
        {
            GarmentPackingListViewModel viewModel = ViewModel;

            viewModel.Items = new List <GarmentPackingListItemViewModel>
            {
                new GarmentPackingListItemViewModel
                {
                    Details = new List <GarmentPackingListDetailViewModel>
                    {
                        new GarmentPackingListDetailViewModel()
                    }
                }
            };

            var result = viewModel.Validate(null);

            Assert.NotEmpty(result.ToList());
        }
        public void Validate_QuantityDifferent()
        {
            GarmentPackingListViewModel viewModel = ViewModel;

            foreach (var item in viewModel.Items)
            {
                foreach (var detail in item.Details)
                {
                    foreach (var size in detail.Sizes)
                    {
                        size.Quantity = 1;
                    }
                    detail.QuantityPCS    = 2;
                    detail.CartonQuantity = 3;
                }
                item.Quantity = 4;
            }

            var result = viewModel.Validate(null);

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