public void Ctor_IntNegative_Error()
		{
			CustomAssert.ThrowsException<CodedArgumentOutOfRangeException>(() =>
			{
				MaximumLengthConstraint c = new MaximumLengthConstraint(-1);
			});
		}
		public void Ctor_SerializationInfo_Success()
		{
			MaximumLengthConstraint c = new MaximumLengthConstraint(2);
			System.IO.MemoryStream Buffer = SerializationHelper.Serialize(c);
			MaximumLengthConstraint c2 = SerializationHelper.Deserialize<MaximumLengthConstraint>(Buffer);

			Assert.AreEqual(Constraint.MaximumLengthConstraintName, c2.Name);
			Assert.AreEqual(2, c2.MaximumLength);
		}
		public void ToString_Success()
		{
			MaximumLengthConstraint c = new MaximumLengthConstraint(1);
			Assert.AreEqual("[MaxLength(1)]", c.ToString());
		}
		public void Ctor_Int_Success()
		{
			MaximumLengthConstraint c = new MaximumLengthConstraint(0);
			Assert.AreEqual(Constraint.MaximumLengthConstraintName, c.Name);
			Assert.AreEqual(0, c.MaximumLength);
		}
		public void Validate_InvalidData_Success()
		{
			CustomAssert.ThrowsException<CodedArgumentException>(() =>
			{
				MaximumLengthConstraint c = new MaximumLengthConstraint(4);
				IEnumerable<ParameterValidationResult> result = c.Validate(42, ParameterDataType.Bytes, Constants.MemberName);
			});

		}
		public void Ctor_Void_Success()
		{
			MaximumLengthConstraint c = new MaximumLengthConstraint();
			Assert.AreEqual(Constraint.MaximumLengthConstraintName, c.Name);
			Assert.AreEqual(int.MaxValue, c.MaximumLength);
		}
		public void Validate_UriTooLong_Success()
		{
			MaximumLengthConstraint c = new MaximumLengthConstraint(4);
			IEnumerable<ParameterValidationResult> result = c.Validate(new Uri("http://contoso.om"), ParameterDataType.Uri, Constants.MemberName);
			Assert.IsNotNull(result);
			Assert.IsTrue(result.GetEnumerator().MoveNext());
		}
		public void Validate_BytesTooLong_Success()
		{
			MaximumLengthConstraint c = new MaximumLengthConstraint(4);
			IEnumerable<ParameterValidationResult> result = c.Validate(new byte[] { 1, 2, 3, 4, 5, 6 }, ParameterDataType.Bytes, Constants.MemberName);
			Assert.IsNotNull(result);
			Assert.IsTrue(result.GetEnumerator().MoveNext());
		}
		public void Validate_StringTooLong_Success()
		{
			MaximumLengthConstraint c = new MaximumLengthConstraint(4);
			IEnumerable<ParameterValidationResult> result = c.Validate("four and a bit", ParameterDataType.String, Constants.MemberName);
			Assert.IsNotNull(result);
			Assert.IsTrue(result.GetEnumerator().MoveNext());
		}
		public void SetParameters_ParamInv_Error()
		{
			CustomAssert.ThrowsException<ConstraintConfigurationException>(() =>
			{
				MaximumLengthConstraint c = new MaximumLengthConstraint();
				c.SetParametersInternal(new string[] { "narf" }, ParameterDataType.String);
			});
		}
		public void SetParameters_Success()
		{
			MaximumLengthConstraint c = new MaximumLengthConstraint();
			c.SetParametersInternal(new string[] { "1" }, ParameterDataType.String);
			Assert.AreEqual(1, c.MaximumLength);
		}