예제 #1
0
        private void testbadvalue(int n, Object value)
        {
            TypeValidator v = Validator_float.Get(n);

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

            Assert.AreEqual(n - 1, v.GetNDims());
            Assert.AreSame(expectedClass, v.GetExpectedClass());
            Assert.AreEqual(descr, v.ToString());
        }
예제 #3
0
        private void testconstructor(int n, String descr, Type expectedClass)
        {
            TypeValidator v = Validator_float.Get(n);

            Assert.AreEqual(n, v.GetNDims());
            Assert.AreSame(expectedClass, v.GetExpectedClass());
            Assert.AreEqual(descr, v.ToString());
        }
예제 #4
0
        public void Test_float()
        {
            Test(Validator_float.Get(2), 2,

                 new float[][] { new float[] { 0, 0 }, new float[] { 0, 0 } });

            Test(Validator_float.Get(2), 2,

                 new float[][] { new float[] { 1, 1 }, new float[] { 1, 1 } });

            Test(Validator_float.Get(2), 2,

                 new float[][] { new float[] { -1, -1 }, new float[] { -1, -1 } });

            Test(Validator_float.Get(2), 2,

                 new float[][] { new float[] { float.MaxValue, float.MaxValue }, new float[] { float.MaxValue, float.MaxValue } });

            Test(Validator_float.Get(2), 2,

                 new float[][] { new float[] { float.MinValue, float.MinValue }, new float[] { float.MinValue, float.MinValue } });
        }
예제 #5
0
 public void constructor3()
 {
     Validator_float.Get(Validator.MAX_NDIMS + 1);
 }
예제 #6
0
 public void constructor2()
 {
     Validator_float.Get(-1);
 }
예제 #7
0
 public void elementvalidator2()
 {
     Validator_float.Get(0).ElementValidator();
 }