Esempio n. 1
0
        private void testbadvalue(int n, Object value)
        {
            TypeValidator v = Validator_object.Get(n);

            Assert.IsFalse(v.Validate(value));
            Assert.IsFalse(validateValueOk(v, value));
        }
Esempio n. 2
0
        private void testelementvalidator(int n, int k, String descr, Type expectedClass)
        {
            TypeValidator v = (TypeValidator)Validator_object.Get(n).ElementValidator();

            Assert.AreEqual(k, v.GetNDims());
            Assert.AreSame(expectedClass, v.GetExpectedClass());
            Assert.AreEqual(descr, v.ToString());
        }
Esempio n. 3
0
        private void testconstructor(int n, String descr, Type expectedClass)
        {
            TypeValidator v = Validator_object.Get(n);

            Assert.AreEqual(n, v.GetNDims());
            Assert.AreSame(expectedClass, v.GetExpectedClass());
            Assert.AreEqual(descr, v.ToString());
        }
Esempio n. 4
0
        public static Validator_object Get(int nDims)
        {
            CheckDims(nDims);

            if (nDims >= validators.Length)
            {
                return(new Validator_object(nDims));
            }

            Validator_object v = validators[nDims];

            if (v == null)
            {
                v = validators[nDims] = new Validator_object(nDims);
            }

            return(v);
        }
Esempio n. 5
0
 public void constructor3()
 {
     Validator_object.Get(Validator.MAX_NDIMS + 1);
 }
Esempio n. 6
0
 public void constructor2()
 {
     Validator_object.Get(-1);
 }