FormatErrorMessage() public method

public FormatErrorMessage ( String name ) : String
name String
return String
コード例 #1
0
        public void FormatErrorMessage_ForDouble()
        {
            attribute = new MaxValueAttribute(13.44);

            String expected = String.Format(Validations.MaxValue, "Sum", attribute.Maximum);
            String actual = attribute.FormatErrorMessage("Sum");

            Assert.Equal(expected, actual);
        }
コード例 #2
0
        public void FormatErrorMessage_ForInteger()
        {
            attribute = new MaxValueAttribute(10);

            String expected = String.Format(Validations.FieldMustBeLessOrEqualTo, "Sum", attribute.Maximum);
            String actual = attribute.FormatErrorMessage("Sum");

            Assert.Equal(expected, actual);
        }