Hello Nunit users,

 

I'm experiencing some problems with the backward compatibility of NUnit.
I hope you can help me out here. This is the problem:

In my project I have to use the 'old' way of making Nunit tests (long
story, but has to do with automatically generated classes which can't
generate the new TestFixtures). The problem is that when I use
nunit-console (or the nunit2 task), nunit doesn't recognize the
testmethod. It does find the testcase class though, I can see this in
the generated xml. When I add the [Test] attribute above the testmethod,
it suddenly finds it. But as far as I can understand from the
documentation, Nunit should also be able to find methods starting with
test (case insensitive). But unfortunately, it looks like this isn't the
case. A bit strange, but the visual tool in visual studio does work and
runs the unit tests (and thus is better backwards compatible than the
nunit-console).

 

Take this class:

....

public class StringValueTestCase

...

            public void TestEquals()

            {

                  ...

                  Some asserts

                  ...

            }

This is what the part of xml looks like

                     <test-suite name="StringValueTestCase"
success="True" time="0.000" asserts="0">

                       <results />

                     </test-suite>

This code above isn't unit tested, but below is.

 

public class StringValueTestCase

...

            [Test]

            public void TestEquals()

            {

                  ...

                  Some asserts

                  ...

            }

<test-suite name="StringValueTestCase" success="True" time="0.015"
asserts="0">

<results>

<test-case
name="nl.everest.foundation.types.StringValueTestCase.testEquals"
executed="True" success="True" time="0.015" asserts="8" />

</results>

</test-suite>

 

 

My question is, do I not understand the backward compatibality part, or
should the top code be unit-tested and is there a bug in Nunit?

 

 

With kind regards,

 

Martijn Claus

 

PS: I'm using NUnit 2.4.3



Disclaimer:
The information transmitted is intended only for use by the addressee and may 
contain confidential and/or privileged material. Any review, re-transmission, 
dissemination or other use of it, or the taking of any action in reliance upon 
this information by persons and/or entities other than the intended recipient 
is prohibited. If you received this in error, please inform the sender and/or 
addressee immediately and delete the material. Thank you.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to