Author: gert
Date: 2007-10-31 18:23:38 -0500 (Wed, 31 Oct 2007)
New Revision: 88616
Modified:
trunk/gert/build/common/Assert.cs
Log:
Added IsFalse, IsTrue and AreEqual overload.
Modified: trunk/gert/build/common/Assert.cs
===================================================================
--- trunk/gert/build/common/Assert.cs 2007-10-31 23:05:42 UTC (rev 88615)
+++ trunk/gert/build/common/Assert.cs 2007-10-31 23:23:38 UTC (rev 88616)
@@ -3,6 +3,16 @@
class Assert
{
+ public static void AreEqual (string x, string y, string msg)
+ {
+ if (x == null && y == null)
+ return;
+ if ((x == null || y == null) || !x.Equals (y))
+ throw new Exception (string.Format
(CultureInfo.InvariantCulture,
+ "Expected: {0}, but was: {1}. {2}",
+ x, y, msg));
+ }
+
public static void AreEqual (object x, object y, string msg)
{
if (x == null && y == null)
@@ -18,6 +28,18 @@
throw new Exception (msg);
}
+ public static void IsFalse (bool value, string msg)
+ {
+ if (value)
+ throw new Exception (msg);
+ }
+
+ public static void IsTrue (bool value, string msg)
+ {
+ if (!value)
+ throw new Exception (msg);
+ }
+
public static void IsNotNull (object value, string msg)
{
if (value == null)
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches