コード例 #1
0
        public void RCompareAttributeDisplayValueCorrect()
        {
            var result = new RCompareAttribute("Property2").Validate(() => new { Property2 = 10 }, 11, "Property1", "SuperOne");

            Assert.IsNotNull(result);
            Assert.IsTrue(result.ErrorMessage.Contains("SuperOne"));
        }
コード例 #2
0
        public void RCompareAttributePositiveWithComparisonEqual()
        {
            var result = new RCompareAttribute("Property2").Validate(() => new { Property2 = 10 }, 10, "Property1");

            Assert.IsNull(result);
        }
コード例 #3
0
        public void RCompareAttributeNegativeWithComparisonMore()
        {
            var result = new RCompareAttribute("Property2", RComparison.More).Validate(() => new { Property2 = 18 }, 10, "Property1");

            Assert.IsNotNull(result);
        }
コード例 #4
0
        public void RCompareAttributePositiveWithComparisonLess()
        {
            var result = new RCompareAttribute("Property2", RComparison.Less).Validate(() => new { Property2 = 10 }, 8, "Property1");

            Assert.IsNull(result);
        }