Hello,
So, in a MyBO class i have:
[NotNullValidator(MessageTemplate = "Cannot be null!")]
[RangeValidator(0, RangeBoundaryType.Inclusive, 20, RangeBoundaryType.Inclusive, Ruleset="validate_x1")]
public byte x1
{
get;
set;
}
And in a test class:
[TestMethod()]
public void x1Test()
{
MyBO target = new MyBO() { x1 = (byte)20 };
ValidationResults vr = Validation.Validate(target, "validate_x1");
Assert.IsTrue(vr.IsValid);
}
Why i got: Test method TestProject.CatedraBOTest.x1Test threw exception: System.ArgumentException: Object must be of type Int32.. ?
I really don't understand. If i remove the RangeValidator everything works fine. Please help.