public void RequiredValidatorTest() { var model = new RequiedModelTest { Apa = "Pasar Jaya", }; Assert.IsTrue(validator.Validate(model)); model.Apa = ""; Assert.IsFalse(validator.Validate(model)); }
public void ValidateTest() { var model = new RequiedModelTest { Apa = "Pasar Jaya", }; Assert.IsTrue(validator.Validate(model)); Assert.AreEqual(validator.GetErrorMessages(), new List <string>()); model.Apa = ""; Assert.IsFalse(validator.Validate(model)); Assert.AreEqual(1, validator.GetErrorMessages().Count); }