private void testbadvalue(int n, Object value) { TypeValidator v = Validator_float.Get(n); Assert.IsFalse(v.Validate(value)); Assert.IsFalse(validateValueOk(v, value)); }
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()); }
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()); }
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 } }); }
public void constructor3() { Validator_float.Get(Validator.MAX_NDIMS + 1); }
public void constructor2() { Validator_float.Get(-1); }
public void elementvalidator2() { Validator_float.Get(0).ElementValidator(); }