var rea = new RegularExpressionAttributePoker (@"[A-Za-z]");
Assert.AreEqual (@"[A-Za-z]", rea.Pattern, "Patterns not saved correctly.");
Assert.AreEqual (null, rea.ErrorMessage, "Error message not null when not yet matched.");
- Assert.AreEqual ("The field {0} must match the regular expression {1}.", rea.GetErrorMessageString (), "Error message not valid.");
+ Assert.AreEqual ("The field {0} must match the regular expression '{1}'.", rea.GetErrorMessageString (), "Error message not valid.");
}
[Test]
{
var rea = new RegularExpressionAttributePoker (@"[A-Za-z]");
- Assert.AreEqual ("The field MyField must match the regular expression [A-Za-z].",
+ Assert.AreEqual ("The field MyField must match the regular expression '[A-Za-z]'.",
rea.FormatErrorMessage ("MyField"),
"Error message not correctly formatted.");
-#if !NET_4_0
- rea = new RegularExpressionAttributePoker (@"[A-Za-z]");
-#endif
rea.ErrorMessage = "Param 0: {0}";
Assert.AreEqual ("Param 0: MyField", rea.FormatErrorMessage ("MyField"), "Error message not correctly updated.");
-#if !NET_4_0
- rea = new RegularExpressionAttributePoker (@"[A-Za-z]");
-#endif
rea.ErrorMessage = "Param 0: {0}; Param 1: {1}";
Assert.AreEqual ("Param 0: MyField; Param 1: [A-Za-z]", rea.FormatErrorMessage ("MyField"), "Error message not correctly updated.");
Assert.AreEqual ("Param 0: ; Param 1: [A-Za-z]", rea.FormatErrorMessage (null), "Error message fails on null value.");