public void Validate_Success() { LowercaseConstraint c = new LowercaseConstraint(); IEnumerable<ParameterValidationResult> res = c.Validate("some lowercase and 3 numbers and punctuation ...!", ParameterDataType.String, Constants.MemberName); Assert.IsNotNull(res); Assert.IsFalse(res.GetEnumerator().MoveNext()); }
public void Ctor_SerializationInfo_Success() { LowercaseConstraint c = new LowercaseConstraint(); System.IO.MemoryStream Buffer = SerializationHelper.Serialize(c); LowercaseConstraint c2 = SerializationHelper.Deserialize<LowercaseConstraint>(Buffer); Assert.AreEqual(Constraint.LowercaseConstraintName, c2.Name); }
public void Validate_Uppercase_Success() { LowercaseConstraint c = new LowercaseConstraint(); IEnumerable<ParameterValidationResult> res = c.Validate("This Is Uppercase!", ParameterDataType.String, Constants.MemberName); Assert.IsNotNull(res); Assert.IsTrue(res.GetEnumerator().MoveNext()); }
public void ToString_Success() { LowercaseConstraint c = new LowercaseConstraint(); Assert.AreEqual("[Lowercase]", c.ToString()); }
public void Ctor_Void_Success() { LowercaseConstraint c = new LowercaseConstraint(); Assert.AreEqual(Constraint.LowercaseConstraintName, c.Name); }