public void Should_Success_Validate_Data_Null_Items() { GarmentReceiptCorrectionViewModel viewModel = new GarmentReceiptCorrectionViewModel { CorrectionType = "Harga Satuan", URNNo = "test", }; Assert.True(viewModel.Validate(null).Count() > 0); }
public void Should_Success_Validate_Data_Retur() { GarmentReceiptCorrectionViewModel viewModel = new GarmentReceiptCorrectionViewModel { CorrectionType = "Jumlah", URNNo = "test", CorrectionDate = DateTimeOffset.Now, CorrectionNo = "test", Remark = It.IsAny <string>(), Unit = It.IsAny <UnitViewModel>(), Storage = It.IsAny <Lib.ViewModels.IntegrationViewModel.StorageViewModel>(), URNId = It.IsAny <long>(), Items = new List <GarmentReceiptCorrectionItemViewModel> { new GarmentReceiptCorrectionItemViewModel { QuantityCheck = 100, Quantity = 0, CorrectionQuantity = 0, Conversion = It.IsAny <double>(), CorrectionConversion = It.IsAny <double>(), DODetailId = It.IsAny <long>(), EPOItemId = It.IsAny <long>(), FabricType = It.IsAny <string>(), IsSave = true, PRItemId = It.IsAny <long>(), RONo = It.IsAny <string>(), POItemId = It.IsAny <long>(), DesignColor = It.IsAny <string>(), PricePerDealUnit = It.IsAny <double>(), POSerialNumber = It.IsAny <string>(), SmallQuantity = It.IsAny <double>(), URNItemId = It.IsAny <long>(), SmallUomId = It.IsAny <long>(), UomId = It.IsAny <long>(), UomUnit = It.IsAny <string>(), SmallUomUnit = It.IsAny <string>(), ProductRemark = It.IsAny <string>(), Product = It.IsAny <ProductViewModel>(), OrderQuantity = It.IsAny <double>(), }, } }; Assert.True(viewModel.Validate(null).Count() > 0); GarmentReceiptCorrectionViewModel viewModel2 = new GarmentReceiptCorrectionViewModel { CorrectionType = "Konversi", URNNo = "test", Items = new List <GarmentReceiptCorrectionItemViewModel> { new GarmentReceiptCorrectionItemViewModel { QuantityCheck = 100, Quantity = 500, CorrectionQuantity = 0, CorrectionConversion = 0, IsSave = true, OrderQuantity = 200 }, } }; Assert.True(viewModel2.Validate(null).Count() > 0); GarmentReceiptCorrectionViewModel viewModel3 = new GarmentReceiptCorrectionViewModel { CorrectionType = "Jumlah", URNNo = "test", Items = new List <GarmentReceiptCorrectionItemViewModel> { new GarmentReceiptCorrectionItemViewModel { QuantityCheck = 100, Quantity = 500, CorrectionQuantity = -200, IsSave = true, }, } }; Assert.True(viewModel3.Validate(null).Count() > 0); GarmentReceiptCorrectionViewModel viewModel4 = new GarmentReceiptCorrectionViewModel { CorrectionType = "Konversi", URNNo = "test", Items = new List <GarmentReceiptCorrectionItemViewModel> { new GarmentReceiptCorrectionItemViewModel { QuantityCheck = 100, Quantity = 500, CorrectionQuantity = 0, CorrectionConversion = 1, IsSave = true, OrderQuantity = 1000 }, } }; Assert.True(viewModel4.Validate(null).Count() > 0); }
public void Should_Success_Validate_Data() { GarmentReceiptCorrectionViewModel AllNullViewModel = new GarmentReceiptCorrectionViewModel(); Assert.True(AllNullViewModel.Validate(null).Count() > 0); }