Priority
Normal
Type
Feature 
State
Fixed 
Assignee
Victor Kropp 
Subsystem
Unit Testing 
Affected versions
Fixed in
Fixed in build
Next build 
  • Submitted by   Ronald Ratzlaff
    3 years ago (21 Jun 2007 01:45)
  • Updated by   Ronald Ratzlaff
    11 months ago (27 Aug 2009 19:00)
  • Jira: RSRP-43833
    (history, comments)
RSRP-43833 Unit Test Runner does not appear to support NUnit ExpectedMessage and MatchType named parameters on the ExpectedException attribute. This was introduced with NUnit 2.4.
26

Links (show as list)

NUnit 2.4 introduced the following named parameters: ExpectedMessage, UserMessage, MatchType, Handler. These do not appear to be supported by Unit Test Runner in Resharper 3.0 RC2.

See http://nunit.com/index.php?p=exception&r=2.4.1

Issue was resolved
Comments (14)
 
History
 
Linked Issues (1)
 
TeamCity Changes (0)
 
Brian
  Brian
02 Oct 2007 23:09
(2 years ago)
This issue also exists on Resharper

ReSharper 3.0.2 C# Edition build 3.0.517.8 on 2007-08-21T09:41:12
Samuel Neff
  Samuel Neff
10 Mar 2008 16:49
(2 years ago)
We had to change some our tests to only check for ArgumentException without checking the message since part of the message changes each time. We'd really like to see this supported.

Using R# 4 EAP and TeamCity (not sure if TeamCity has same issue or not–we haven't tested it since it doesn't work in R#).
Lukas Masser
  Lukas Masser
16 Oct 2008 19:00
(21 months ago)
If I have to choose between support for RSRP-40575 and this and will choose this as would make testing for ArgumentException among other so much more convenient.
sukchr
  sukchr
09 Jan 2009 17:12
(18 months ago)
Any action on this issue? I'd really like to see it resolved :)
Bob Robson
  Bob Robson
21 Jan 2009 20:22
(18 months ago)
I'm using R# 4.1, this defect was reported in 3.0. I'm very dissappointed that this has not been addressed by now. We have run into this issue and are forced to either install another runner or change our tests. Can it be so hard to support? If you're going to do a runner, why not make it support all of the functionality of NUnit?
Steffen Forkmann
  Steffen Forkmann
11 Mar 2009 14:40
(16 months ago)
Code sample for false positive test error
using System;
using NUnit.Framework;

namespace ClassLibrary1
{
    [TestFixture]
    public class Test
    {      
        [Test, ExpectedException(typeof(Exception))]
        public void TestOkInResharperTestRunnerAndNUnit()
        {
            throw new Exception("Crash!");
        }

        // false positive test failure
        [Test, ExpectedException(ExpectedMessage = "Crash!")]
        public void TestFailsInResharperTestRunnerButNotInNUnit()
        {
            throw new Exception("Crash!");
        }
    }
}
Steffen Forkmann
  Steffen Forkmann
11 Mar 2009 14:47
(16 months ago)
Another false positive
[Test, ExpectedException]
public void TestFailsInResharperTestRunnerButNotInNUnit()
{
    throw new Exception("Crash!");
}


This small is a false positive in Resharper Test runner. Maybe it is just the missing exception type?!
Ilya Ryzhenkov
  Ilya Ryzhenkov
13 Mar 2009 10:51
(16 months ago)
We are going to improve all kinds of NUnit testing in ReSharper 5.
Tony OHagan
  Tony OHagan
27 Mar 2009 02:13
(16 months ago)
This is an important feature that most test driven developers would frequently use.
The bug was reported in Jun 07 ! But you're saying that we will have to wait 2 years to get it fixed??!
Since it's already coded for 5.0, perhaps you can merge it into a patch for 4.1 eh?
William Sorensen
  William Sorensen
22 Apr 2009 04:26
(15 months ago)
R# 4.5 C# edition build 4.5.1231.7 still has this bug. Example:

[Test, ExpectedException(typeof(ArgumentNullException), ExpectedMessage = "aParentContainer", MatchType = MessageMatch.Contains)]

The MatchType directive is ignored.

We had to wait a significant period of time for SetUpFixture support. By the time you have full NUnit 2.4.8 support. NUnit 2.5 will be out. You've got a GREAT product, but it annoys me that you don't seem to think the test runner is an important feature.
Sean Aitken
  Sean Aitken
07 May 2009 23:35
(14 months ago)
R# 4.5 build 1234 also still has this bug. Guess I'm gonna fall back to TestDriven.NET for now. (Can't R# just rely on the nunit libraries for dealing with this??)
Matthew Quinn
  Matthew Quinn
03 Jun 2009 17:18
(13 months ago)
FYI:
This problem can be worked around with NUnit 2.5 by using

Assert.Throws<Exception>(() => { your test code here });

or other variants of Assert.Throws
Boris
  Boris
13 Jul 2009 23:14
(12 months ago)
Hi, I'm also highly interested in a solution to this issue. We're now actively using R# and we have this problem for a few our NUnit projects. Rewriting them is out of the question unfortunately.

I've read the post here, http://www.jetbrains.net/devnet/thread/281286, that says to try the nightly builds for 4.5.1, but the latest from 7/11 didn't have this fixed. Any idea on when this will be done?

Thanks,
Boris.
Victor Kropp
  Victor Kropp
27 Aug 2009 19:00
(11 months ago)
Fixed in R# 5.0.