Esempio n. 1
0
        public void FormatMessageDoesNotThrowExceptionAlthoughTheParameterDoesNotExist()
        {
            const string messageFormat = "'{ValueName}' must be greater than or equal to '{ValueToCompare}'.";

            StringReplaceValidationMessageFormatter validationMessageFormatter = new StringReplaceValidationMessageFormatter();

            Assert.AreEqual("'Age' must be greater than or equal to '{ValueToCompare}'.", validationMessageFormatter.FormatMessage(messageFormat, new Dictionary <string, string> {
                { "ValueName", "Age" }
            }));
        }
Esempio n. 2
0
        public void FormatMessage()
        {
            const string messageFormat = "'{ValueName}' must be greater than or equal to '{ValueToCompare}'.";

            StringReplaceValidationMessageFormatter validationMessageFormatter = new StringReplaceValidationMessageFormatter();

            Assert.AreEqual("'Age' must be greater than or equal to '40'.", validationMessageFormatter.FormatMessage(messageFormat, new Dictionary <string, string> {
                { "ValueName", "Age" }, { "ValueToCompare", "40" }
            }));
        }