MudassarRasool / mb-unit

Automatically exported from code.google.com/p/mb-unit
0 stars 0 forks source link

A FormatException occurs in MbUnit.Framework.Assert.IsTrue when the mesage is a long stack trace. #866

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Assert.IsTrue(false, very long stack trace)
2.
3.

What is the expected output? What do you see instead?
EXPECTED: A failed test with the stack trace. 

ACTUAL: 
An exception occurred while verifying an assertion.
at MbUnit.Samples.IssueDemos.LongStackTrace() in IssueDemos.cs: line 61
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, 
ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, 
ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart() 

What version of the product are you using? On what operating system?
OS W7
3.3.0, 3.3.1 

Please provide any additional information below.
Attached a test that reproduces the problem. 

Original issue reported on code.google.com by Cliff.Bu...@gmail.com on 25 Oct 2011 at 6:10

GoogleCodeExporter commented 8 years ago

Original comment by Cliff.Bu...@gmail.com on 25 Oct 2011 at 6:10

Attachments:

GoogleCodeExporter commented 8 years ago
Looking at the exception, this would probably occur any time the message 
contains braces. The simplest fix would be to not run it through string.format 
in no arguments parameters are present.

Original comment by Cliff.Bu...@gmail.com on 25 Oct 2011 at 6:13

GoogleCodeExporter commented 8 years ago
I can't reproduce this :(

The tests fail, but not because of a FormatException. We did have problems 
before, when the string was too long.

Original comment by grahamr...@gmail.com on 31 Oct 2011 at 5:56

GoogleCodeExporter commented 8 years ago
What version can you not reproduce this in? What runner? The tests are supposed 
to fail, but should report the exception. MBunit 3.3.1 via Resharper. Original 
issue was  3.3.0 via echo or icarus.

[Test]
public void ShortMessageWithBraces()
{
    Assert.IsTrue(false, @"Hello {{{");
}

This is not a critical problem.

Original comment by Cliff.Bu...@gmail.com on 3 Nov 2011 at 6:41