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

Notification

Icon
Error

nunit TestCase not working with ExpectedResult
Henrry
#1 Posted : Tuesday, May 23, 2017 8:11:36 AM(UTC)
Rank: Member

Groups: Registered
Joined: 1/12/2017(UTC)
Posts: 18
Location: United Kingdom

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

I have this test

[Test]
[TestCase(null, ExpectedResult = JobStatus.DocumentDelivery)]
[TestCase("9999999999999999", ExpectedResult = JobStatus.InComplete)]
public JobStatus SetJobSetIncompleteStatus(string invoiceNumber)
{
var job = new Job
{
JobStatus = JobStatus.DocumentDelivery,
InvoiceNumber = invoiceNumber
};

service.SetIncompleteStatus(job);
return job.JobStatus;
}

when i run this test with the nunit test runner the it passes, as expected, but when i run it with ncrunch this is the result

1 -> Expected: null was: DocumentDelivery
2 -> Expected: null was: InComplete


Does any one had this same kind of issue?
Ralf Koban
#2 Posted : Tuesday, May 23, 2017 8:27:31 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 5/19/2014(UTC)
Posts: 44
Location: Germany

Thanks: 4 times
Was thanked: 10 time(s) in 9 post(s)
Hi,

what happens if you remove the [Test] attribute? You already mark it as a test via the [TestCase] attribute.

BR,
Ralf
Henrry
#3 Posted : Tuesday, May 23, 2017 10:18:11 AM(UTC)
Rank: Member

Groups: Registered
Joined: 1/12/2017(UTC)
Posts: 18
Location: United Kingdom

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
Event without the test attribute it fails

thanks for your suggestion anyway
Remco
#4 Posted : Tuesday, May 23, 2017 11:28:25 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Hi Henrry,

I can't seem to recreate this problem when using the latest version of NUnit.

Which version of NUnit are you using?
Henrry
#5 Posted : Tuesday, May 23, 2017 11:40:11 AM(UTC)
Rank: Member

Groups: Registered
Joined: 1/12/2017(UTC)
Posts: 18
Location: United Kingdom

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

this is the nuget package that i have installed
...packages\NUnit.3.2.0\lib\net45\nunit.framework.dll

kind regards
Henrry
Remco
#6 Posted : Tuesday, May 23, 2017 12:27:46 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Thanks for confirming. This is the same one I also tested with :(

Is there any chance you can put together a sample solution that can reproduce this issue? You can submit it through the contact form.
Henrry
#7 Posted : Tuesday, May 23, 2017 3:41:57 PM(UTC)
Rank: Member

Groups: Registered
Joined: 1/12/2017(UTC)
Posts: 18
Location: United Kingdom

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
Sure Remco

I will do it

Kind regards
Henrry Pires
Henrry
#8 Posted : Friday, June 9, 2017 11:18:36 AM(UTC)
Rank: Member

Groups: Registered
Joined: 1/12/2017(UTC)
Posts: 18
Location: United Kingdom

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

Sorry for the delay. I just sent via the contact form as requested a demo project


Kind regards
Henrry
Remco
#9 Posted : Friday, June 9, 2017 11:41:48 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Hi Henrry,

Thanks for sending through the sample project. I've tested this at my end and I can confirm that it works with the latest release of NCrunch (v3.9).

I believe the problem you are experiencing is due to a compatibility issue that has been fixed in a later release than the one you are using. The version you're running (v2.18) is more than 18 months old, and there have been considerable changes to the ecosystem with many updates to the NUnit3 integration during these 18 months. v2.18 was released only a couple of weeks after the first introduction of NUnit3 integration, so the code you are running on is early generation and likely will have issues, especially with the newer versions of NUnit that have been released far more recently.

To resolve this problem, you'll need to upgrade your version of NCrunch.
1 user thanked Remco for this useful post.
Henrry on 6/9/2017(UTC)
Henrry
#10 Posted : Friday, June 9, 2017 11:59:06 AM(UTC)
Rank: Member

Groups: Registered
Joined: 1/12/2017(UTC)
Posts: 18
Location: United Kingdom

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

It works fine
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.068 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download