public void TestPutValidatorNull() { XType t = new XType("t"); Field f = new Field("f"); Validator v = Validator_int.Get(0); Assert.IsNull(t.GetValidator(f)); t.PutValidator(f, null); Assert.IsNull(t.GetValidator(f)); t.PutValidator(f, v); Assert.AreEqual(v, t.GetValidator(f)); t.PutValidator(f, v); Assert.AreEqual(typeof(ComboValidator), (t.GetValidator(f)).GetType()); t.ClearValidator(f); Assert.IsNull(t.GetValidator(f)); }
public void TestGetValidator() { XType t = new XType("t"); Field f = new Field("f"); Field g = new Field("g"); Validator v = Validator_int.Get(0); t.PutValidator(f, v); Assert.AreEqual(v, t.GetValidator(f)); Assert.IsNull(t.GetValidator(g)); }
public TestStructValue() { mt1.PutValidator(mf1, Validator_boolean.Get(0)); mt1.PutValidator(mf2, Validator_boolean.Get(1)); mt1.PutValidator(mf3, Validator_int.Get(0)); mt1.PutValidator(mf4, Validator_int.Get(1)); mt1.PutValidator(mf5, Validator_string.Get(0)); mt1.PutValidator(mf6, Validator_string.Get(1)); }