Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
 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));
 }