0

Closed

Assert messages with formatting characters in them may cause exceptions.

description

When an assert message string has formatting characters such as "{" that are used by string.Format(...) and no formatting arguments are supplied then string.Format(...) throws an exception. For example:
    AssertEx.That(() => false, "Test { test }");
 
The AssertEx is turned into an Assert.IsTrue(false, "Test { test }", object[]). The Assert then tries to build the message with string.Format(...) and throw the exception because "{ test }" isn't valid.
Closed May 3, 2009 at 5:02 PM by JeffLeBert

comments

wrote May 3, 2009 at 5:02 PM

Resolved with changeset 13140.

wrote Jan 21, 2013 at 7:37 PM

wrote May 13, 2013 at 6:38 PM