public void RCompareAttributeDisplayValueCorrect() { var result = new RCompareAttribute("Property2").Validate(() => new { Property2 = 10 }, 11, "Property1", "SuperOne"); Assert.IsNotNull(result); Assert.IsTrue(result.ErrorMessage.Contains("SuperOne")); }
public void RCompareAttributePositiveWithComparisonEqual() { var result = new RCompareAttribute("Property2").Validate(() => new { Property2 = 10 }, 10, "Property1"); Assert.IsNull(result); }
public void RCompareAttributeNegativeWithComparisonMore() { var result = new RCompareAttribute("Property2", RComparison.More).Validate(() => new { Property2 = 18 }, 10, "Property1"); Assert.IsNotNull(result); }
public void RCompareAttributePositiveWithComparisonLess() { var result = new RCompareAttribute("Property2", RComparison.Less).Validate(() => new { Property2 = 10 }, 8, "Property1"); Assert.IsNull(result); }