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

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

            Assert.AreEqual(n - 1, 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_string.Get(n);

            Assert.AreEqual(n, v.GetNDims());
            Assert.AreSame(expectedClass, v.GetExpectedClass());
            Assert.AreEqual(descr, v.ToString());
        }
Esempio n. 4
0
        public static void Init(XType type, Class2TypeMap class2type)
        {
            Field field = type.GetField(FIELD_NAME);

            class2type.Add(typeof(_Etch_RuntimeException), type);
            type.SetComponentType(typeof(_Etch_RuntimeException));
            type.SetImportExportHelper(new RuntimeExceptionSerializer(type, field));
            type.PutValidator(field, Validator_string.Get(0));
            type.Lock();
        }
Esempio n. 5
0
        public void Test_string()
        {
            Test(Validator_string.Get(2), 2,

                 new String[][] { new String[] { "", "" }, new String[] { "", "" } });

            Test(Validator_string.Get(2), 2,

                 new String[][] { new String[] { "abc", "abc" }, new String[] { "abc", "abc" } });
        }
Esempio n. 6
0
        /// <summary></summary>
        /// <param name="nDims">number of dimensions. 0 for a scalar.</param>
        /// <returns>an instance of the validator</returns>
        public static Validator_string Get(int nDims)
        {
            CheckDims(nDims);

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

            Validator_string v = validators[nDims];

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

            return(v);
        }
Esempio n. 7
0
 public void constructor3()
 {
     Validator_string.Get(Validator.MAX_NDIMS + 1);
 }
Esempio n. 8
0
 public void constructor2()
 {
     Validator_string.Get(-1);
 }
Esempio n. 9
0
 public void elementvalidator2()
 {
     Validator_string.Get(0).ElementValidator();
 }