public void Ctor_ByteNoValue_Success()
		{
			ParameterDataType type = ParameterDataType.Byte;
			MinimumValueConstraint c = new MinimumValueConstraint(type);
			Assert.AreEqual(Constraint.MinimumValueConstraintName, c.Name);
			Assert.AreEqual(type, c.DataType);
			Assert.AreEqual(byte.MaxValue, c.MinimumValue);
		}
		public void Ctor_ByteWithConversion_Success()
		{
			ParameterDataType type = ParameterDataType.Byte;
			object value = (int)42;
			MinimumValueConstraint c = new MinimumValueConstraint(type, value);
			Assert.AreEqual(Constraint.MinimumValueConstraintName, c.Name);
			Assert.AreEqual(type, c.DataType);
			Assert.AreEqual((byte)42, c.MinimumValue);
		}
		public void Validate_ConversionFailed_Error()
		{
			CustomAssert.ThrowsException<CodedArgumentException>(() =>
			{
				ParameterDataType type = ParameterDataType.UInt16;
				object minValue = (ushort)50;
				object value = -1;
				MinimumValueConstraint c = new MinimumValueConstraint(type, minValue);
				IEnumerable<ParameterValidationResult> result = c.Validate(value, type, Constants.MemberName);
			});
		}
		public void Validate_NotConvertible_Error()
		{
			CustomAssert.ThrowsException<CodedArgumentException>(() =>
			{
				ParameterDataType type = ParameterDataType.DateTimeOffset;
				object minValue = DateTimeOffset.Now.AddDays(1.0);
				object value = 42;
				MinimumValueConstraint c = new MinimumValueConstraint(type, minValue);
				IEnumerable<ParameterValidationResult> result = c.Validate(value, type, Constants.MemberName);
			});
		}
		public void Validate_Version_Success()
		{
			ParameterDataType type = ParameterDataType.Version;
			object minValue = new Version(1, 1, 0, 0);
			object value = new Version(1, 1, 2, 0);
			MinimumValueConstraint c = new MinimumValueConstraint(type, minValue);
			IEnumerable<ParameterValidationResult> result = c.Validate(value, type, Constants.MemberName);
			Assert.IsNotNull(result);
			Assert.IsFalse(result.GetEnumerator().MoveNext());
		}
		public void Validate_UInt64_Success()
		{
			ParameterDataType type = ParameterDataType.UInt64;
			object minValue = (ulong)42;
			object value = (ulong)50;
			MinimumValueConstraint c = new MinimumValueConstraint(type, minValue);
			IEnumerable<ParameterValidationResult> result = c.Validate(value, type, Constants.MemberName);
			Assert.IsNotNull(result);
			Assert.IsFalse(result.GetEnumerator().MoveNext());
		}
		public void Validate_TimeSpan_Success()
		{
			ParameterDataType type = ParameterDataType.TimeSpan;
			object minValue = TimeSpan.FromSeconds(42.0);
			object value = TimeSpan.FromSeconds(50.0);
			MinimumValueConstraint c = new MinimumValueConstraint(type, minValue);
			IEnumerable<ParameterValidationResult> result = c.Validate(value, type, Constants.MemberName);
			Assert.IsNotNull(result);
			Assert.IsFalse(result.GetEnumerator().MoveNext());
		}
		public void Ctor_NotConvertible_Error()
		{
			CustomAssert.ThrowsException<ParameterConversionException>(() =>
			{
				ParameterDataType type = ParameterDataType.DateTimeOffset;
				object value = 42;
				MinimumValueConstraint c = new MinimumValueConstraint(type, value);
			});
		}
		public void Validate_DateTimeOffset_Success()
		{
			ParameterDataType type = ParameterDataType.DateTimeOffset;
			object minValue = DateTimeOffset.Now;
			object value = DateTimeOffset.Now.AddDays(1.0);
			MinimumValueConstraint c = new MinimumValueConstraint(type, minValue);
			IEnumerable<ParameterValidationResult> result = c.Validate(value, type, Constants.MemberName);
			Assert.IsNotNull(result);
			Assert.IsFalse(result.GetEnumerator().MoveNext());
		}
		public void Validate_ByteWithConvAltValue_Success()
		{
			ParameterDataType type = ParameterDataType.Byte;
			object minValue = (byte)42;
			object value = (int)44;
			MinimumValueConstraint c = new MinimumValueConstraint(type, minValue);
			IEnumerable<ParameterValidationResult> result = c.Validate(value, type, Constants.MemberName);
			Assert.IsNotNull(result);
			Assert.IsFalse(result.GetEnumerator().MoveNext());
		}
		public void SetParameters_ParamInv_Error()
		{
			CustomAssert.ThrowsException<ConstraintConfigurationException>(() =>
			{
				MinimumValueConstraint c = new MinimumValueConstraint(ParameterDataType.Int32);
				c.SetParametersInternal(new string[] { "narf" }, ParameterDataType.Int32);
			});
		}
		public void SetParameters_Success()
		{
			MinimumValueConstraint c = new MinimumValueConstraint(ParameterDataType.Int32);
			c.SetParametersInternal(new string[] { "1" }, ParameterDataType.Int32);
			Assert.AreEqual(1, c.MinimumValue);
		}
		public void ToString_Success()
		{
			MinimumValueConstraint c = new MinimumValueConstraint(ParameterDataType.Int32, 42);
			Assert.AreEqual("[MinValue(42)]", c.ToString());
		}
		public void Ctor_SerializationInfo_Success()
		{
			MinimumValueConstraint c = new MinimumValueConstraint(ParameterDataType.Int32, 42);
			System.IO.MemoryStream Buffer = SerializationHelper.Serialize(c);
			MinimumValueConstraint c2 = SerializationHelper.Deserialize<MinimumValueConstraint>(Buffer);

			Assert.AreEqual(Constraint.MinimumValueConstraintName, c2.Name);
			Assert.AreEqual(ParameterDataType.Int32, c.DataType);
			Assert.AreEqual(42, c2.MinimumValue);
		}
		public void Ctor_ConversionFailed_Error()
		{
			CustomAssert.ThrowsException<ParameterConversionException>(() =>
			{
				ParameterDataType type = ParameterDataType.Byte;
				object value = 300;
				MinimumValueConstraint c = new MinimumValueConstraint(type, value);
			});
		}
		public void Validate_Int32TooSmall_Success()
		{
			ParameterDataType type = ParameterDataType.Int32;
			object minValue = 51;
			object value = 50;
			MinimumValueConstraint c = new MinimumValueConstraint(type, minValue);
			IEnumerable<ParameterValidationResult> result = c.Validate(value, type, Constants.MemberName);
			Assert.IsNotNull(result);
			Assert.IsTrue(result.GetEnumerator().MoveNext());
		}
		public void Ctor_TypeNotSupported_Error()
		{
			CustomAssert.ThrowsException<CodedArgumentException>(() =>
			{
				ParameterDataType type = ParameterDataType.Uri;
				MinimumValueConstraint c = new MinimumValueConstraint(type);
			});
		}
		public void Ctor_ValueNull_Error()
		{
			CustomAssert.ThrowsException<CodedArgumentNullException>(() =>
			{
				ParameterDataType type = ParameterDataType.Byte;
				object value = null;
				MinimumValueConstraint c = new MinimumValueConstraint(type, value);
			});
		}