예제 #1
0
        public void FormatErrorMessage_ForInteger()
        {
            attribute = new GreaterThanAttribute(10);

            String expected = String.Format(Validations.GreaterThan, "Sum", attribute.Minimum);
            String actual   = attribute.FormatErrorMessage("Sum");

            Assert.Equal(expected, actual);
        }
예제 #2
0
        public void FormatErrorMessage_ForName()
        {
            attribute = new GreaterThanAttribute(12.56);

            String actual   = attribute.FormatErrorMessage("Sum");
            String expected = Validation.For("GreaterThan", "Sum", attribute.Minimum);

            Assert.Equal(expected, actual);
        }
예제 #3
0
        public void FormatErrorMessage_FormatsErrorMessageForDouble()
        {
            attribute = new GreaterThanAttribute(12.56);

            String expected = String.Format(Validations.FieldMustBeGreaterThan, "Sum", attribute.Minimum);
            String actual   = attribute.FormatErrorMessage("Sum");

            Assert.Equal(expected, actual);
        }