Bug 17289 - NUnit "TestCase" annotation of test method is not supported
Summary: NUnit "TestCase" annotation of test method is not supported
Status: RESOLVED ANSWERED
Alias: None
Product: Tools
Classification: Mono
Component: other ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2014-01-17 06:13 UTC by Sadik Ali
Modified: 2017-09-01 08:58 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description Sadik Ali 2014-01-17 06:13:58 UTC
Following are the steps to reproduce:

1. Create a NUnit Library project
2. Add below test case in to NUnit test class

       [TestCase(12, 3, 4)]
        public void TestCase2(int a, int b, int c)
        {
            Assert.AreEqual (b, a/c);
        }
3. Build application.
4. I am getting error message "`NUnit.Framework.TestCase': is not an attribute class"

Refer Screen shot: http://screencast.com/t/62iPRcKkNaxY

I have also checked this test case on VS 2012 and executed successfully.
Refer screen cast: http://screencast.com/t/1gYOVDncX9

Environment Detail:

XS 4.2.3(Build 23)
MAC
Comment 1 Mike Krüger 2014-01-20 02:31:25 UTC
That's no error - that's c#.

You've a method named 'TestCase' in that class - try to name it 'TestCase1' (like you did in vs.net) and it should work.
Comment 2 Sadik Ali 2014-01-20 02:59:21 UTC
I did exactly same as in VS but still getting same error:

Refer screen shot: http://screencast.com/t/5DnNKR7w5

Let me know if I am missing any thing
Comment 3 Mike Krüger 2014-01-20 04:14:11 UTC
Seems to be a version mismatch. 

Go to the project options and turn off the 'MSBuild engine' -> that should now link to a newer version.

Seems that mono is delivered with nunit 2.4.
Comment 4 Mike Krüger 2014-01-20 04:18:36 UTC
I'm not sure if 'tools' is the correct category, but it's something that needs to be changed inside the mono distribution:

Mono should update it's nunit version.

It's still delivered with 2.4.x and that collides with the monodevelop delivered 2.6.x version.
Comment 5 Marek Safar 2017-09-01 08:58:35 UTC
Mono bundled nunit is now deprecated. Please use nuget package instead