private void TestBadValue(int n, Object value) { TypeValidator v = Validator_boolean.Get(n); Assert.IsFalse(v.Validate(value)); Assert.IsFalse(ValidateValueOk(v, value)); }
private void TestElementValidator(int n, String descr, Type expectedClass) { Validator_boolean v = (Validator_boolean)Validator_boolean.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) { Validator_boolean v = Validator_boolean.Get(n); Assert.AreEqual(n, v.GetNDims()); Assert.AreSame(expectedClass, v.GetExpectedClass()); Assert.AreEqual(descr, v.ToString()); }
public void Test_boolean() { Test(Validator_boolean.Get(2), 2, new Boolean[][] { new Boolean[] { false, false }, new Boolean[] { false, false } }); Test(Validator_boolean.Get(2), 2, new Boolean[][] { new Boolean[] { true, true }, new Boolean[] { true, true } }); }
/// <summary> /// /// </summary> /// <param name="nDims">number of dimensions. 0 for a scalar.</param> /// <returns>an instance of the validator</returns> public static Validator_boolean Get(int nDims) { CheckDims(nDims); if (nDims >= validators.Length) { return(new Validator_boolean(nDims)); } Validator_boolean v = validators[nDims]; if (v == null) { v = validators[nDims] = new Validator_boolean(nDims); } return(v); }
public void Constructor3() { Validator_boolean.Get(Validator.MAX_NDIMS + 1); }
public void Constructor2() { Validator_boolean.Get(-1); }
public void ElementValidator2() { Validator_boolean.Get(0).ElementValidator(); }