This is a migrated thread and some comments may be shown as answers.

Unit Test Integration not Working With NUnit

18 Answers 195 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Brian Mains
Top achievements
Rank 1
Brian Mains asked on 16 Jul 2010, 11:53 PM
Hello,

I cannot get the unit test integration to work with NUnit 2.5.5.  I am using the latest, but it's not loading the tests and I don't see the testing menu...

Any ideas?

Thanks.

18 Answers, 1 is accepted

Sort by
0
Per D. H. Pasgaard
Top achievements
Rank 1
answered on 17 Jul 2010, 12:22 PM
I'm having the same problem
0
Per D. H. Pasgaard
Top achievements
Rank 1
answered on 17 Jul 2010, 12:52 PM
I installed NUnit 2.5.4 and 2.5.2 and changed my references. I also re-installed JustCode, but none of this helped. 
0
Robert
Top achievements
Rank 1
answered on 18 Jul 2010, 05:07 PM
I'm also having this problem. I've built my tests over and over again, but JustCode doesn't seem to recognize there are unit tests to be run.
0
Gianluca Mariani
Top achievements
Rank 2
answered on 18 Jul 2010, 07:49 PM
Me too. i have the same problem.
0
Deyan Varchev
Telerik team
answered on 19 Jul 2010, 07:47 AM
Hello everyone,

Thanks for reporting this problem and accept my apologies for any inconvenience JustCode have caused you. I see that this problem is quite common so we must take care of it as soon as possible.
We have one known issue with NUnit which could be the cause of your problems. JustCode's test runner does not recognize correctly unit tests that use attribute inheritance. Meaning, that if you have TestFixture attribute on some base class and Test attributes on methods of a derived class, the test runner won't show those tests. The problem appeared a bit too late and we weren't able to fix it for the release. However we consider it with highest priority and will fix it for the next internal build we release.

In case the issue I described is not your case, it would be of great help for us if you could provide some more info for the problem. For starters try and create a simple test class with test method and see if JustCode will show that method in the test window.

Thanks a lot for the collaboration in advance.

Best wishes,
Deyan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Per D. H. Pasgaard
Top achievements
Rank 1
answered on 19 Jul 2010, 09:07 AM
Well, I'm not inheriting anything from the "TestFixture class", so here is my simple example:

I followed your video: http://tv.telerik.com/watch/justcode/using-unit-test-runner-with-different-test-frameworks,
created a new project (ClassLibrary) having only a single file with the content shown here below and a reference to the NUnit-framework ver. 2.5.5.

According to your video, the tests should automatically show up in the JustCode "Unit Test Window" immediately after the name of a test-procedure is typed (having the [Test]-attribute applied) - but this does not happen.

=========================================
using NUnit.Framework;
namespace TestJustCode
{
    [TestFixture]
    public class NUnitTests
    {
        [Test]
        public void mytest()
        {
        }
    }
}
=========================================

0
Robert
Top achievements
Rank 1
answered on 19 Jul 2010, 01:09 PM
Deyan,

I'm in the same situation as Per D. H. Pasgaard. I'm not doing anything special with my unit tests; just a TextFixture with a single Test inside.

Thanks for the quick response, it's much appreciated.
0
Deyan Varchev
Telerik team
answered on 19 Jul 2010, 01:55 PM
Hi Robert, Per D. H. Pasgaard,

Could you open a support ticket and attach the sample solutions in which you are experiencing this problem. Also JustCode's the log files will be really useful for us - they can be found in your AppData\Local\JustCode\Logs folder. 


Sincerely yours,
Deyan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Per D. H. Pasgaard
Top achievements
Rank 1
answered on 19 Jul 2010, 02:33 PM
Done!

ticket ID is : 329425
0
Per D. H. Pasgaard
Top achievements
Rank 1
answered on 19 Jul 2010, 03:11 PM
FYI: (Just received this reply from Devan:)

"Thanks a lot for sending this so quickly. The problem seems to be that you use the TestCase attribute to mark test methods instead of Just the Test attribute. If you don't pass any parameters to the TestCase then it is the same as using the Test attribute. It appears that JustCode does not look for the TestCase attribute but rather only for the Test attribute. That will certainly be fixed in the next internal build we release. As a possible workaround you can either change the TestCase attributes with Test attributes, where you don't pass any parameters to the test method. And in other cases where parameters are required use the TestCaseSource attribute or some of the other NUnit data driven attributes (Values, Range, etc.)."

It did the trick for me! ;-)
0
Brian Mains
Top achievements
Rank 1
answered on 19 Jul 2010, 09:47 PM
I use [Test], nothing works.  I'll submit a ticket too.
0
Peter
Top achievements
Rank 1
answered on 11 Apr 2011, 10:37 AM
Hi all,

I don't know if this problem is already solved, but I was also experiencing it.
After some experimenting with some test projects, I found out that JustCode does not recognize Test projects that whose name doen't end in "Test".

I named all my projects ".Test" on the end and they didn't work. After I renamed them to "Test" (without the ".") my problem was solved.

I hope it helps.

Sincerely
0
Robert
Top achievements
Rank 1
answered on 17 Apr 2011, 03:17 PM
How is it that it is almost a year later, but this bug is STILL NOT fixed?
0
Blagoev
Telerik team
answered on 26 Apr 2011, 08:32 AM
Hi Robert,
Thanks for asking. We are currently planning big improvements in our unit test runner and infrastructure. This will get fixed also. I pumped its priority to make sure it gets fixed before anything else. Sorry for the delay.

Regards,
Blagoev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Nick
Top achievements
Rank 2
answered on 21 May 2011, 08:55 PM
Is there any way we can get access to the new upgrade?  Because for most of my projects the testing works great, however in some projects, using the same version of NUnit mind you, nothing seems to work, and for the life of me I cannot figure out what the difference is between the two projects.

Has anybody had any luck fixing this issue?
0
Blagoev
Telerik team
answered on 25 May 2011, 02:36 PM
Hello Nick,
I think i answeared your ticket but still others may have the same problem so I will write the solution here.
 
When using NUnit make sure your test namespace is not named "Test" but something else ("Tests" will do). Or make sure you use fully quallified name for the NUnit [Test] attribute like so [NUnit.Framework.Test]

This is a problem in JustCode and we will be wokring on solving it in future releases.

Kind regards,
Blagoev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
ATeam
Top achievements
Rank 1
answered on 26 May 2011, 01:39 PM
Hello,

I just want to report that we also have the problem, that if the namespace our testprojects  contains ".Test" the test isn't shown in the justcode test window. In normal NUnit window it worked.
0
Blagoev
Telerik team
answered on 27 May 2011, 10:14 AM
Hello Dominik Fürst,
Yes thats the issue. As a woraround you can use the description in my previous post. We will be devising a fix for that.

Greetings,
Blagoev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Brian Mains
Top achievements
Rank 1
Answers by
Per D. H. Pasgaard
Top achievements
Rank 1
Robert
Top achievements
Rank 1
Gianluca Mariani
Top achievements
Rank 2
Deyan Varchev
Telerik team
Brian Mains
Top achievements
Rank 1
Peter
Top achievements
Rank 1
Blagoev
Telerik team
Nick
Top achievements
Rank 2
ATeam
Top achievements
Rank 1
Share this question
or