public void Test_FieldIsNumeric() { ValidatorNumber validator = new ValidatorNumber(); string errorMsg; bool result = validator.ValidateField("12345", out errorMsg); Assert.IsTrue(result); Assert.AreEqual(errorMsg, "", "errorMsg is: " + errorMsg); }
public void Test_FieldIsNotNumeric() { ValidatorNumber validator = new ValidatorNumber(); string errorMsg; bool result = validator.ValidateField("abc", out errorMsg); Assert.IsFalse(result); Assert.AreEqual(errorMsg, "Field does not only contain numbers: abc", "errorMsg is: " + errorMsg); }