Resharper fails to recognize exceptions ?
Hello !
Here is simple unit test with NUnit framework.
public class Class1
{
[Test]
[ExpectedException(typeof(SystemException))]
public void ThrowsApplicationException()
{
throw new ApplicationException();
}
}
This test fails in NUnit test runner, but succedes in Resharper test runner.
Thanks!
Please sign in to leave a comment.
Hello Alexey
Which version of NUnit are you using? Does this test fail in NUnit 2.5.3 test runner? Thank you!
Andrey Serebryansky
Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"I'm using NUnit 2.4.8. There is different behaviour in 2.4.8 and 2.5.3 This test succedes in 2.5.3
P.S. here is bug description: https://bugs.launchpad.net/nunitv2/+bug/498662
Thanks for your answer !
Hi, i've got the same issue (also Nunit 2.4.8)
We're planning on upgrading N-unit, but in the mean while, will there be a fix for resharper?
Sample code:
// Test succeeds
[Test,ExpectedException(typeof(SqlException))]
public void ShouldFailBecauseOfWrongExceptionType()
{
throw new ArgumentException();
}
// Test Fails
[Test, ExpectedException(typeof(SqlException))]
public void ShouldFailBecauseNoExceptionIsThrown()
{
}
Resharper version details:
JetBrains ReSharper 5 C# Edition
Build 5.0.1659.36 on 2010-04-13T02:19:06