private void testbadvalue(int n, Object value) { TypeValidator v = Validator_short.Get(n); Assert.IsFalse(v.Validate(value)); Assert.IsFalse(validateValueOk(v, value)); }
public void Test_short() { Test(Validator_short.Get(2), 2, new short[][] { new short[] { 0, 0 }, new short[] { 0, 0 } }); Test(Validator_short.Get(2), 2, new short[][] { new short[] { 1, 1 }, new short[] { 1, 1 } }); Test(Validator_short.Get(2), 2, new short[][] { new short[] { -1, -1 }, new short[] { -1, -1 } }); Test(Validator_short.Get(2), 2, new short[][] { new short[] { SByte.MaxValue, SByte.MaxValue }, new short[] { SByte.MaxValue, SByte.MaxValue } }); Test(Validator_short.Get(2), 2, new short[][] { new short[] { SByte.MinValue, SByte.MinValue }, new short[] { SByte.MinValue, SByte.MinValue } }); Test(Validator_short.Get(2), 2, new short[][] { new short[] { short.MaxValue, short.MaxValue }, new short[] { short.MaxValue, short.MaxValue } }); Test(Validator_short.Get(2), 2, new short[][] { new short[] { short.MinValue, short.MinValue }, new short[] { short.MinValue, short.MinValue } }); }
private void testelementvalidator(int n, String descr, Type expectedClass) { TypeValidator v = (TypeValidator)Validator_short.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_short.Get(n); Assert.AreEqual(n, v.GetNDims()); Assert.AreSame(expectedClass, v.GetExpectedClass()); Assert.AreEqual(descr, v.ToString()); }
public void constructor3() { Validator_short.Get(Validator.MAX_NDIMS + 1); }
public void constructor2() { Validator_short.Get(-1); }
public void elementvalidator2() { Validator_short.Get(0).ElementValidator(); }