question about test suites
"Jerry Shea" <[email protected]> Wed, 26 Nov 2008 21:31:23 +1100
| Newsgroups | gmane.comp.windows.dotnet.nunit.user |
|---|---|
| Message-ID | <[email protected]> |
--===============1960764706732758020==
Content-Type: multipart/alternative;
boundary="----=_Part_11964_12306459.1227695483863"
------=_Part_11964_12306459.1227695483863
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hi Everyone,
I'm trying to follow the instructions on the doco for
SuiteAttribute<http://www.nunit.org/index.php?p=suite&r=2.4.7>for
nunit
2.4.7. I copied the code to define the suite from that page and tried to
create a suite containing a customised instance of my test. I would expect
to see "xxxx" output to the console but instead "hello" is - my Suite
property is being ignored. Can anyone help?
Thx
namespace NunitSuiteTest {
using System;
using System.Collections;
using NUnit.Framework;
public class AllTests {
[Suite]
public static IEnumerable Suite {
get {
ArrayList suite = new ArrayList();
suite.Add(new ATest("xxxx"));
return suite;
}
}
}
[TestFixture]
public class ATest {
private string message = "hello";
public ATest() { }
public ATest(string m) {
this.message = m;
}
[Test]
public void Hello() {
Console.WriteLine(message);
}
}
}
------=_Part_11964_12306459.1227695483863
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hi Everyone,<br><br>I'm trying to follow the instructions on the <a href="http://www.nunit.org/index.php?p=suite&r=2.4.7">doco for SuiteAttribute</a> for nunit <a href="http://2.4.7.">2.4.7.</a> I copied the code to define the suite from that page and tried to create a suite containing a customised instance of my test. I would expect to see "xxxx" output to the console but instead "hello" is - my Suite property is being ignored. Can anyone help?<br>
<br>Thx<br><br>namespace NunitSuiteTest {<br> using System;<br> using System.Collections;<br> using NUnit.Framework;<br><br> public class AllTests {<br> [Suite]<br> public static IEnumerable Suite {<br>
get {<br> ArrayList suite = new ArrayList();<br> suite.Add(new ATest("xxxx"));<br> return suite;<br> }<br> }<br> }<br> <br> [TestFixture]<br>
public class ATest {<br> private string message = "hello";<br><br> public ATest() { }<br> public ATest(string m) {<br> this.message = m;<br> }<br><br> [Test]<br>
public void Hello() {<br> Console.WriteLine(message);<br> }<br> }<br>}<br><br>
------=_Part_11964_12306459.1227695483863--
--===============1960764706732758020==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
--===============1960764706732758020==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Nunit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nunit-users
--===============1960764706732758020==--