Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Always black dots
theDiver
#1 Posted : Monday, October 3, 2011 1:16:49 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/3/2011(UTC)
Posts: 9

Thanks: 2 times
Was thanked: 2 time(s) in 2 post(s)
Hi there

Just found your tool today, and took it for a testdrive.

I installed the newest nUnit, and the newest nCrunch.

I followed the demo video, but wrote my own classed.

nUnit tell's me the test have passed, but nCrunch only shows black dots.

Any idea?
Remco
#2 Posted : Monday, October 3, 2011 1:57:37 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi, thanks for posting!

Are you trying out NCrunch in a test solution, or a real world one?

Are your tests showing in the NCrunch tests window?
theDiver
#3 Posted : Tuesday, October 4, 2011 8:11:06 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/3/2011(UTC)
Posts: 9

Thanks: 2 times
Was thanked: 2 time(s) in 2 post(s)
Hello Remco.

It is a very simple console application test project. I Used Visual Studio 2010, Target Framework is 4.0 Client Profile (Default)
Tried 3.5 framework, no change.

There is black dots next to the lines in all 3 files.


Program.cs:

Code:
using System;

namespace nCrunchTest
{
    class Program
    {
        static void Main(string[] args)
        {
            int x = MyClass.add(10, 20);
        }
    }
}


MyClass.cs:
Code:
using System;

namespace nCrunchTest
{
    public class MyClass
    {
        public static int add(int a, int b)
        {
            return a + b;
        }
    }
}


TestClass.cs
Code:
using NUnit.Framework;

namespace nCrunchTest
{
    [TestFixture]
    public class TestClass
    {
        [TestCase]
        public void addTest()
        {
            int a = 5;
            int b = 7;
            int expected = 13;

            int result = MyClass.add(a, b);

            Assert.That(result,Is.EqualTo(expected));
        }
    }
}


As you can see i have told the test to fail.

In the 'NCrunch Tests' windows the test is marked as passed.

When i run nUnit it fails as expected.

If i change the expected value to 12, NCrunch still show 'passed' in 'NCrunch Tests' windows, but not nUnit passes also.

In the Task Manager i can see the NCrunch.TaskRunner40.x86.exe does use CPU when i change the code.
The NCrunch Processing Queue show 'Build Assembly' Complete.

p.s.Never had the change before to play with unit testing, unfortunately never had the change to be allowed the time at work ;-( So it might simply be a stupid newbie error with nUnit :)
Remco
#4 Posted : Tuesday, October 4, 2011 7:30:42 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
I think there is something unusual happening under the hood - caused by some kind of environment issue most likely. Would you be able to submit a bug report using the NCrunch menu? This will send through a log file so I can see what's going on :)
theDiver
#5 Posted : Tuesday, October 4, 2011 8:01:42 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/3/2011(UTC)
Posts: 9

Thanks: 2 times
Was thanked: 2 time(s) in 2 post(s)
Sure, i'll send it when i get to my development computer in about 9 hours time :-)

The only special environment thing i can think about, is that it is an english Windows XP running with Danish Locale setting.
1 user thanked theDiver for this useful post.
Remco on 10/5/2011(UTC)
theDiver
#6 Posted : Wednesday, October 5, 2011 7:08:30 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/3/2011(UTC)
Posts: 9

Thanks: 2 times
Was thanked: 2 time(s) in 2 post(s)
The bug report has been submitted.
Remco
#7 Posted : Wednesday, October 5, 2011 7:12:43 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Thanks for sending the bug report. Looking through it, it seems that NCrunch isn't finding the tests at all ... are you sure they're showing in the tests window?

Also, are you able to run tests using any other test runner (i.e. MSTest)?
theDiver
#8 Posted : Thursday, October 6, 2011 9:20:22 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/3/2011(UTC)
Posts: 9

Thanks: 2 times
Was thanked: 2 time(s) in 2 post(s)
Hi there

It looks like NCrunch does see the tests, and show them always as passed.

While playing around, I though about moving the test to another Visual Studio Project, because in a real application, I don't want the tests to be in the same exe/dll as the rest of my program.

So i created a DLL project, and moved the TestClass functionality to it, and wupti, everything works as expected :-)

Thanks for your time, and i am looking forward to playing with the tool.

p.s. What unit test framework do you suggest to use, i mostly develop web applications, with the businesslogic in it's own DLL's.
Remco
#9 Posted : Thursday, October 6, 2011 6:52:28 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 931 times
Was thanked: 1257 time(s) in 1170 post(s)
Interesting - Is there any chance you'd be able to share the source code of your test project with me? I'd like to know why it didn't work for you in the smaller solution.

Personally I use NUnit - not because I think it's necessarily better, but because I'm a bit old-school and when I first started with TDD it was the only framework available. Having experimented with the major frameworks during NCrunch development (inside and out), I would have to say that your choice of test framework should be driven far more by how you choose to express your requirements as opposed to the sort of application you're building ... I'm sure many people would have different opinions on this that they could share :)
theDiver
#10 Posted : Friday, October 7, 2011 8:24:31 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/3/2011(UTC)
Posts: 9

Thanks: 2 times
Was thanked: 2 time(s) in 2 post(s)
I have send you an PM with the download link.

Thanks for the tips regarding the unit test frameworks, i'll have to play around with them :)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.059 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download