[Mono-bugs] [Bug 76928][Nor] Changed - [PATCH] nunit: nunit tests
that use C# 2.0 features do not run properly
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Mon Jan 2 16:47:30 EST 2006
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by charlie at nunit.com.
http://bugzilla.ximian.com/show_bug.cgi?id=76928
--- shadow/76928 2005-12-12 16:29:46.000000000 -0500
+++ shadow/76928.tmp.4276 2006-01-02 16:47:30.000000000 -0500
@@ -137,6 +137,32 @@
add nunit-console2 script.
------- Additional Comments From nazgul at omega.pl 2005-12-12 16:29 -------
Created an attachment (id=16204)
This patch installd specialized nunit-console.exe.config files for 1.0 and 2.0 profiles
+
+------- Additional Comments From charlie at nunit.com 2006-01-02 16:47 -------
+Everyone should be aware that running NUnit - whichever compile -
+under 2.0 solves the initial bug with int? but not all possible bugs. :-)
+
+For example, in order to make all combinations of int and int? work
+with Assert.AreEqual, I woule have to add 2.0-specific code to NUnit.
+As of now, we aren't adding such code - I expect to do it for 3.0.
+
+In specific cases, I've been able to make such tests work by creating
+a derived Assert class internal to the test itself and adding the
+appropriate methods. For example...
+
+ private class Assert : NUnit.Framework.Assert
+ {
+ public static void AreEqual(int expected, int? actual)
+ {
+ Assert.AreEqual((int?)expected, actual);
+ }
+ public static void AreEqual(int? expected, int actual)
+ {
+ Assert.AreEqual(expected, (int?)actual);
+ }
+ }
+
+
More information about the mono-bugs
mailing list