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

Notification

Icon
Error

Can't covering the test method in VS2010?
Ray
#1 Posted : Thursday, April 19, 2012 11:54:48 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/19/2012(UTC)
Posts: 4


hi, all, there is a problem in my pc.

I installed the Version 1.38b for VS2010. But it's not working in my VS2010.

When I using it, it always show the test method isn't covering.

I don't know why, anybody can help me ?

The code is following:

using NUnit.Framework;

namespace NCrunchTest
{
[TestFixture]
public class Test
{
[Test]
public void AddTest()
{
NCrunchTest test=new NCrunchTest();
int sum = test.Add(3, 4);
Assert.AreEqual(7, sum);
}
}
}
Remco
#2 Posted : Friday, April 20, 2012 3:20:03 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 929 times
Was thanked: 1256 time(s) in 1169 post(s)
Hi Ray,

I'm wondering if you'd be able to answer some of the following questions - this will help me to better establish what is happening in your codebase.

- Does NCrunch run for any project/solution at all on your machine?
- Does the Tests Window list any tests at all? (make sure you don't have them ignored)
- If you go to the processing queue, do you see any errors against any of the tasks in the queue?
- When you describe the test method as not being covered, do you see any black circles next to the code?


Thanks!

Remco
Ray
#3 Posted : Friday, April 20, 2012 4:14:29 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/19/2012(UTC)
Posts: 4

Remco;1710 wrote:
Hi Ray,

I'm wondering if you'd be able to answer some of the following questions - this will help me to better establish what is happening in your codebase.

- Does NCrunch run for any project/solution at all on your machine?
- Does the Tests Window list any tests at all? (make sure you don't have them ignored)
- If you go to the processing queue, do you see any errors against any of the tasks in the queue?
- When you describe the test method as not being covered, do you see any black circles next to the code?


Thanks!

Remco


Thanks for your answer, but the problem still trouble me.

- Does NCrunch run for any project/solution at all on your machine?
I using it in a simple test project.

- Does the Tests Window list any tests at all? (make sure you don't have them ignored)
The Tests Window has a tip: No tests are queued for execution. Monitoring no tests, with 1 test ignored.

- If you go to the processing queue, do you see any errors against any of the tasks in the queue?
Only has the Analyse Assembly and Build Assembly tasks, and the state are all Complete.

- When you describe the test method as not being covered, do you see any black circles next to the code?
Yes, there is a black circles at left of the line.

Looking forward to your reply.
Thanks,
Ray


Remco
#4 Posted : Friday, April 20, 2012 4:20:40 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 929 times
Was thanked: 1256 time(s) in 1169 post(s)
Hi Ray -

Thanks for the feedback. It appears as though the problem is simply that you've ignored the test you're trying to execute with NCrunch. Most likely you took the default option during the startup wizard to 'Ignore all tests, I will choose which tests to run with NCrunch manually'.

In the Tests Window, click the grey circle with a line through it in order to show all the tests that you have ignored. Right click on the project showing and choose 'Unignore' from the context menu. The project with all of its tests should no longer be ignored by NCrunch and your test(s) should run.


Cheers,

Remco
Ray
#6 Posted : Friday, April 20, 2012 4:40:46 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/19/2012(UTC)
Posts: 4

Remco;1712 wrote:
Hi Ray -

Thanks for the feedback. It appears as though the problem is simply that you've ignored the test you're trying to execute with NCrunch. Most likely you took the default option during the startup wizard to 'Ignore all tests, I will choose which tests to run with NCrunch manually'.

In the Tests Window, click the grey circle with a line through it in order to show all the tests that you have ignored. Right click on the project showing and choose 'Unignore' from the context menu. The project with all of its tests should no longer be ignored by NCrunch and your test(s) should run.


Cheers,

Remco



But I changed the Ignored Tests during the Run Configuration Wizard, I selected the "Let my test run- I will ignore them as a need to" option and I didn't find the grey circle and the "Unignore" from the context menu. The NCrunch always hints me there is no ignore test in project. And the circle in the left of line always black....
I don't know why....
Ray
#5 Posted : Friday, April 20, 2012 4:51:47 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/19/2012(UTC)
Posts: 4

Remco;1712 wrote:
Hi Ray -

Thanks for the feedback. It appears as though the problem is simply that you've ignored the test you're trying to execute with NCrunch. Most likely you took the default option during the startup wizard to 'Ignore all tests, I will choose which tests to run with NCrunch manually'.

In the Tests Window, click the grey circle with a line through it in order to show all the tests that you have ignored. Right click on the project showing and choose 'Unignore' from the context menu. The project with all of its tests should no longer be ignored by NCrunch and your test(s) should run.


Cheers,

Remco



Oh, maybe I know the reason, I used the console application before, so the test method couldn't be covered, So I create a class library and copy the test class into it, the NCrunch is working.

Thank you very much.
Ray
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.045 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download