Different results in nunit gui and console

103 views
Skip to first unread message

mikedrmfs

unread,
Feb 4, 2012, 10:55:41 PM2/4/12
to NUnit-Discuss
The nunit-console runs without an error but nunit.exe (gui) gives this
error

OdeToFood.Tests.HomeControllerIndexTest.Puts_Message_In_ViewBag:
System.NullReferenceException : Object reference not set to an
instance of an object.

at OdeToFood.Controllers.HomeController.Index() in C:\websites
\OdeToFood\OdeToFood\Controllers\HomeController.cs:line 15
at OdeToFood.Tests.HomeControllerIndexTest.Puts_Message_In_ViewBag()
in C:\websites\OdeToFood\OdeToFood.Tests\HomeControllerTest.cs:line 17


Why does the gui get an error and the console run clean?
Thanks

Charlie Poole

unread,
Feb 6, 2012, 6:25:47 PM2/6/12
to nunit-...@googlegroups.com
Hi Mike,

The general, not-very-helpful answer is that the two runners contain
different code. :-) The execution code will be unified in the nunit engine
under NUnit 3.0. Of course, that only means they will both do the
same thing - they could still both fail.

I suggest you start by debugging into your test and figuring out exactly
what it is that's unexpectedly null and where it comes from. NUnit could
still be the culprit, but we have to start where the error is found.

Charlie

> --
> You received this message because you are subscribed to the Google Groups "NUnit-Discuss" group.
> To post to this group, send email to nunit-...@googlegroups.com.
> To unsubscribe from this group, send email to nunit-discus...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/nunit-discuss?hl=en.
>

Sean W.

unread,
Apr 5, 2012, 6:22:43 AM4/5/12
to NUnit-Discuss
I too am having a similar issue after trying to upgrade to 2.6.
We currently use 2.5.3.9345 and all tests pass. Upgraded to
2.6.0.12051 and all tests pass in the GUI, not some tests fail in the
console.

I can try to debug some of the failing tests today and reply later.

Is something wrong with the new release?

On Feb 6, 7:25 pm, Charlie Poole <nunit...@gmail.com> wrote:
> Hi Mike,
>
> The general, not-very-helpful answer is that the two runners containdifferentcode. :-) The execution code will be unified in thenunitengine
> underNUnit3.0. Of course, that only means they will both do the
> same thing - they could still both fail.
>
> I suggest you start by debugging into your test and figuring out exactly
> what it is that's unexpectedly null and where it comes from.NUnitcould
> still be the culprit, but we have to start where the error is found.
>
> Charlie
>
>
>
>
>
>
>
> On Sat, Feb 4, 2012 at 7:55 PM, mikedrmfs <mike.davis...@gmail.com> wrote:
> > Thenunit-consoleruns without an error butnunit.exe (gui) gives this
> > error
>
> > OdeToFood.Tests.HomeControllerIndexTest.Puts_Message_In_ViewBag:
> > System.NullReferenceException : Object reference not set to an
> > instance of an object.
>
> > at OdeToFood.Controllers.HomeController.Index() in C:\websites
> > \OdeToFood\OdeToFood\Controllers\HomeController.cs:line 15
> > at OdeToFood.Tests.HomeControllerIndexTest.Puts_Message_In_ViewBag()
> > in C:\websites\OdeToFood\OdeToFood.Tests\HomeControllerTest.cs:line 17
>
> > Why does theguiget an error and theconsolerun clean?
> > Thanks
>
> > --
> > You received this message because you are subscribed to the Google Groups "NUnit-Discuss" group.
> > To post to this group, send email tonunit...@googlegroups.com.
> > To unsubscribe from this group, send email tonunit-discu...@googlegroups.com.

Charlie Poole

unread,
Apr 5, 2012, 2:41:23 PM4/5/12
to nunit-...@googlegroups.com
A bug has been reported in the Gui by which failing tests are not
propagated to the higher level suite. The failed test is marked as
failed in the tree, but it's parent suites don't show the failure.
Could you check to see if that's your situation or if the test is
actually shown as passing?

For a failed test, you should see the failure in the Errors and
Failures tab and it should also be indicated on the test properties
display, accessible through the context menu. Please check both
places.

This way we can figure out if it's a known bug or something new.

Charlie

> To post to this group, send email to nunit-...@googlegroups.com.
> To unsubscribe from this group, send email to nunit-discus...@googlegroups.com.

Sean W.

unread,
Apr 5, 2012, 3:02:07 PM4/5/12
to NUnit-Discuss
Different situation.

As stated above. The GUI passes all. The Console has errors in 2.6.

Charlie Poole

unread,
Apr 5, 2012, 3:07:05 PM4/5/12
to nunit-...@googlegroups.com
OK, then you probably have the same situation as Mike, as you stated.

Note that I asked Mike for more info in February but there has been
no reply. So I'll pass the request to you. :-)

Can you debug into this and find out exactly what is failing in the
Gui but working in the console? That's really the only way we can
start looking into it.

Charlie

Sean W.

unread,
Apr 5, 2012, 3:07:35 PM4/5/12
to NUnit-Discuss
Expanding to the individual test is green in the GUI. But fails in the
console. It was ~1% of tests failing in console in 2.6. All pass in
2.5.3.

Charlie Poole

unread,
Apr 5, 2012, 3:12:18 PM4/5/12
to nunit-...@googlegroups.com
Ah... so it's actually the reverse of the OP's situation.

Do the failing tests have anything in common? Do the errors?
Can you replicate this with an example?

Failing that, let's pick a test and look at it in detail.

Charlie

Reply all
Reply to author
Forward
0 new messages