← Back to team overview

nunit-core team mailing list archive

Re: [Bug 488002] Re: Should not report tests in abstract class as invalid

 

This was a puzzler! But here's the answer...

1. The two tests were removed only because an abstract class
is technically neither runnable nor non-runnable. It's just 
ignored by NUnit in normal operation. However, leaving the
tests in to prevent a regression is probably a good idea.

2. What was actually being fixed was not tested - or more
exactly, I did an adhoc test and then removed it. However,
I figured out a way to test it. If you add this to the
TestFixtureTests class, it will cause an error without
your changes (because it tries to build the test) but
simply ignore the class with your changes.

 [TestFixture]
 public abstract class NUnitShouldIgnoreThisAbstractTestFixture
 {
 }

Do you want me to go ahead and merge in your changes, together
with the extra test?

Charlie

PS: Thanks for all the work you have been doing. I hope you'll
be able to find time to keep it up. Let me know when you're ready 
for more suggestions... :-)

> -----Original Message-----
> From: bounces@xxxxxxxxxxxxx [mailto:bounces@xxxxxxxxxxxxx] On 
> Behalf Of Adam Connelly
> Sent: Sunday, December 27, 2009 9:44 AM
> To: charlie@xxxxxxxxx
> Subject: [Bug 488002] Re: Should not report tests in abstract 
> class as invalid
> 
> I'm still confused :(. The problem I'm having is that I can 
> add the new tests that you added, but not remove the tests 
> that you removed. Then when I run the tests, they pass 
> regardless of whether I make the changes to 
> NUnitTestFixtureBuilder that you made or not. This makes me 
> think that either the changes I'm making aren't tested 
> properly, or they aren't actually changing the behaviour. 
> I've pushed the changes I've made so far to 
> https://code.launchpad.net/~adam-rpconnelly/nunit-3.0/bug-4880
> 02. Any chance you could take a look at them and give me a hand?
> 
> --
> Should not report tests in abstract class as invalid
> https://bugs.launchpad.net/bugs/488002
> You received this bug notification because you are a bug assignee.
>

-- 
Should not report tests in abstract class as invalid
https://bugs.launchpad.net/bugs/488002
You received this bug notification because you are a member of NUnit
Core Developers, which is the registrant for NUnit Framework.

Status in NUnit Test Framework: Triaged
Status in NUnit V2 Test Framework: Fix Released

Bug description:
Making a class abstract should be sufficient to indicate the test fixture is intended to be inherited by other concrete test fixture.

The problem occurs when the said abstract test fixture inherits from a 3rd party test fixture that already has TestFixture attribute, there is no way to avoid the warning now.

See http://groups.google.com/group/nunit-discuss/browse_thread/thread/b0d491a5df2e7897/3150383c3129273b





References