Unit Test Integration not Working With NUnit

19 posts, 0 answers
  1. Brian Mains
    Brian Mains avatar
    485 posts
    Member since:
    Oct 2008

    Posted 16 Jul 2010 Link to this post

    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.
  2. Per D. H. Pasgaard
    Per D. H. Pasgaard avatar
    6 posts
    Member since:
    Aug 2009

    Posted 17 Jul 2010 Link to this post

    I'm having the same problem
  3. DevCraft banner
  4. Per D. H. Pasgaard
    Per D. H. Pasgaard avatar
    6 posts
    Member since:
    Aug 2009

    Posted 17 Jul 2010 Link to this post

    I installed NUnit 2.5.4 and 2.5.2 and changed my references. I also re-installed JustCode, but none of this helped. 
  5. Robert
    Robert avatar
    9 posts
    Member since:
    Jul 2010

    Posted 18 Jul 2010 Link to this post

    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.
  6. Gianluca Mariani
    Gianluca Mariani avatar
    30 posts
    Member since:
    Aug 2004

    Posted 18 Jul 2010 Link to this post

    Me too. i have the same problem.
  7. Deyan Varchev
    Admin
    Deyan Varchev avatar
    150 posts

    Posted 19 Jul 2010 Link to this post

    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
  8. Per D. H. Pasgaard
    Per D. H. Pasgaard avatar
    6 posts
    Member since:
    Aug 2009

    Posted 19 Jul 2010 Link to this post

    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()
            {
            }
        }
    }
    =========================================

  9. Robert
    Robert avatar
    9 posts
    Member since:
    Jul 2010

    Posted 19 Jul 2010 Link to this post

    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.
  10. Deyan Varchev
    Admin
    Deyan Varchev avatar
    150 posts

    Posted 19 Jul 2010 Link to this post

    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
  11. Per D. H. Pasgaard
    Per D. H. Pasgaard avatar
    6 posts
    Member since:
    Aug 2009

    Posted 19 Jul 2010 Link to this post

    Done!

    ticket ID is : 329425
  12. Per D. H. Pasgaard
    Per D. H. Pasgaard avatar
    6 posts
    Member since:
    Aug 2009

    Posted 19 Jul 2010 Link to this post

    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! ;-)
  13. Brian Mains
    Brian Mains avatar
    485 posts
    Member since:
    Oct 2008

    Posted 19 Jul 2010 Link to this post

    I use [Test], nothing works.  I'll submit a ticket too.
  14. Peter
    Peter avatar
    6 posts
    Member since:
    Jan 2009

    Posted 11 Apr 2011 Link to this post

    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
  15. Robert
    Robert avatar
    9 posts
    Member since:
    Jul 2010

    Posted 17 Apr 2011 Link to this post

    How is it that it is almost a year later, but this bug is STILL NOT fixed?
  16. Blagoev
    Admin
    Blagoev avatar
    49 posts

    Posted 26 Apr 2011 Link to this post

    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
  17. Nick
    Nick avatar
    3 posts
    Member since:
    Jul 2012

    Posted 21 May 2011 Link to this post

    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?
  18. Blagoev
    Admin
    Blagoev avatar
    49 posts

    Posted 25 May 2011 Link to this post

    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
  19. ATeam
    ATeam avatar
    24 posts
    Member since:
    Jan 2010

    Posted 26 May 2011 Link to this post

    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.
  20. Blagoev
    Admin
    Blagoev avatar
    49 posts

    Posted 27 May 2011 Link to this post

    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
Back to Top
DevCraft banner