public async void Validate_ViewModel_Duplicate()
        {
            var serviceProvider = GetServiceProvider();

            var service = new GarmentLeftoverWarehouseProductService(serviceProvider.Object, _dbContext(GetCurrentMethod()));

            serviceProvider.Setup(s => s.GetService(typeof(IGarmentLeftoverWarehouseProductService)))
            .Returns(service);

            var data = await _dataUtil(service).GetTestData();

            var viewModel = new GarmentLeftoverWarehouseProductViewModel
            {
                Code            = data.Code,
                Name            = data.Name,
                UomId           = data.UomId,
                UomUnit         = data.UomUnit,
                ProductTypeId   = data.ProductTypeId,
                ProductTypeCode = data.ProductTypeCode,
                ProductTypeName = data.ProductTypeName
            };

            var validationContext = new ValidationContext(viewModel, serviceProvider.Object, null);

            var result = viewModel.Validate(validationContext);

            Assert.NotEmpty(result.ToList());
        }
        public void Validate_ViewModel()
        {
            var serviceProvider = GetServiceProvider();

            var viewModel         = new GarmentLeftoverWarehouseProductViewModel();
            var validationContext = new ValidationContext(viewModel, serviceProvider.Object, null);

            var result = viewModel.Validate(validationContext);

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