← Back to team overview

nunit-core team mailing list archive

[Bug 1047272] Re: TestContext.CurrentContext.Result throws NullReferenceException

 

I'm afraid I got a little confused between the 2.6.1 release and the
work I'm doing for NUnitLite and NUnit 3.0. In the latter, newer,
versions, full test info is made available to TestFixtureSetUp and
TestFixtureTearDown methods. In 2.6.1, the information is really only
available for the test itself and for Setup and  TearDown.

I'm changing this to a feature request for 2.6.2. It's actually not
clear if we will be able to do it, however. Both NUnit 3.0 and NUnitLite
use a completely new design for executing tests, which has made it
possible for us to provide this feature. I'll have to check and see if
we can make the info available using the 2.6 codebase, without major
design changes.

One comment: you indicate you use the TestFixtureSetUp method before
each test to determine if the test should be executed. This isn't
possible, because the TestFixtureSetUp method doesn't run before each
test. It only runs once, before all the tests.

Charlie

** Changed in: nunitv2
       Status: New => Triaged

** Changed in: nunitv2
   Importance: Undecided => Wishlist

-- 
You received this bug notification because you are a member of NUnit
Developers, which is subscribed to NUnit V2.
https://bugs.launchpad.net/bugs/1047272

Title:
  TestContext.CurrentContext.Result throws NullReferenceException

Status in NUnit V2 Test Framework:
  Triaged

Bug description:
  We are using stable NUnit 2.6 for testing using C# .Net code mainly due to new /runlist command line option.
  Before each test in method with TestFixtureSetUp attribute we check if the test shouldn't be skipped. If so Assert.Ignore is called.
  Later in method with TestFixtureTearDown attribute we are used to check TestContext.CurrentContext.Result for actual test result and report it. In version 2.5.8 it worked correctly and Status in Result was properly set. Since 2.6.0 it throws NullReferenceException. Is it something planned and we should call Assert.Ignore or check for the Result somewhere else? Thanks

To manage notifications about this bug go to:
https://bugs.launchpad.net/nunitv2/+bug/1047272/+subscriptions


References