fix ET tests for 4.0
authorJb Evain <jbevain@gmail.com>
Tue, 6 Apr 2010 15:45:31 +0000 (15:45 -0000)
committerJb Evain <jbevain@gmail.com>
Tue, 6 Apr 2010 15:45:31 +0000 (15:45 -0000)
svn path=/trunk/mcs/; revision=154861

mcs/class/System.Core/Test/System.Linq.Expressions/ExpressionTest_AndAlso.cs
mcs/class/System.Core/Test/System.Linq.Expressions/ExpressionTest_Call.cs
mcs/class/System.Core/Test/System.Linq.Expressions/ExpressionTest_Convert.cs
mcs/class/System.Core/Test/System.Linq.Expressions/ExpressionTest_Equal.cs
mcs/class/System.Core/Test/System.Linq.Expressions/ExpressionTest_OrElse.cs

index 2368e07dcbe1c2203f84d92b3b06c9c5940ac7a7..27a7e2ec3e7bea0dd1fd727152f7e343c10fd104 100644 (file)
@@ -80,7 +80,9 @@ namespace MonoTests.System.Linq.Expressions
                        Assert.AreEqual (ExpressionType.AndAlso, expr.NodeType, "AndAlso#01");
                        Assert.AreEqual (typeof (bool), expr.Type, "AndAlso#02");
                        Assert.IsNull (expr.Method, "AndAlso#03");
+#if !NET_4_0
                        Assert.AreEqual ("(True && False)", expr.ToString(), "AndAlso#04");
+#endif
                }
 
                [Test]
@@ -95,8 +97,10 @@ namespace MonoTests.System.Linq.Expressions
                        Assert.AreEqual (typeof (OpClass), expr.Type, "AndAlso#06");
                        Assert.AreEqual (mi, expr.Method, "AndAlso#07");
                        Assert.AreEqual ("op_BitwiseAnd", expr.Method.Name, "AndAlso#08");
+#if !NET_4_0
                        Assert.AreEqual ("(value(MonoTests.System.Linq.Expressions.OpClass) && value(MonoTests.System.Linq.Expressions.OpClass))",
                                expr.ToString(), "AndAlso#09");
+#endif
                }
 
                [Test]
index 25125c8850c04a357b02aec4e9b111b34e126e53..bc706dc03517d3e921fd113af1a7f9f32b4a77f2 100644 (file)
@@ -87,7 +87,11 @@ namespace MonoTests.System.Linq.Expressions {
                }
 
                [Test]
+#if NET_4_0
+               [ExpectedException (typeof (ArgumentException))]
+#else
                [ExpectedException (typeof (ArgumentNullException))]
+#endif
                public void ArgInstanceNullForNonStaticMethod ()
                {
                        Expression.Call (null, typeof (object).GetMethod ("ToString"));
index 44e61ca82248a13084638dca055e493b73a101b1..21abf915257024989be3ce8eef5ed55ef343a158 100644 (file)
@@ -81,8 +81,9 @@ namespace MonoTests.System.Linq.Expressions {
 
                        var conv = Expression.Convert (p, typeof (ITzap));
                        Assert.AreEqual (typeof (ITzap), conv.Type);
+#if !NET_4_0
                        Assert.AreEqual ("Convert(<param>)", conv.ToString ());
-
+#endif
                        p = Expression.Parameter (typeof (ITzap), null);
                        conv = Expression.Convert (p, typeof (IFoo));
 
index ca3ff35f849d486039cb092cecfe7bc6d6014251..06612bdfa1820c312c899e87bfc69b27cde54db3 100644 (file)
@@ -76,7 +76,9 @@ namespace MonoTests.System.Linq.Expressions
                        Assert.AreEqual (ExpressionType.Equal, expr.NodeType);
                        Assert.AreEqual (typeof (bool), expr.Type);
                        Assert.IsNull (expr.Method);
+#if !NET_4_0
                        Assert.AreEqual ("(1 = 2)", expr.ToString ());
+#endif
                }
 
                [Test]
@@ -93,7 +95,9 @@ namespace MonoTests.System.Linq.Expressions
                        Assert.AreEqual (true, expr.IsLifted);
                        Assert.AreEqual (false, expr.IsLiftedToNull);
                        Assert.IsNull (expr.Method);
+#if !NET_4_0
                        Assert.AreEqual ("(1 = 2)", expr.ToString ());
+#endif
                }
 
                [Test]
@@ -110,7 +114,9 @@ namespace MonoTests.System.Linq.Expressions
                        Assert.AreEqual (true, expr.IsLifted);
                        Assert.AreEqual (true, expr.IsLiftedToNull);
                        Assert.IsNull (expr.Method);
+#if !NET_4_0
                        Assert.AreEqual ("(1 = 2)", expr.ToString ());
+#endif
                }
 
                [Test]
@@ -136,8 +142,9 @@ namespace MonoTests.System.Linq.Expressions
                        Assert.AreEqual (typeof (bool), expr.Type);
                        Assert.AreEqual (mi, expr.Method);
                        Assert.AreEqual ("op_Equality", expr.Method.Name);
-
+#if !NET_4_0
                        Assert.AreEqual ("(value(MonoTests.System.Linq.Expressions.OpClass) = value(MonoTests.System.Linq.Expressions.OpClass))", expr.ToString ());
+#endif
                }
 
                [Test]
index 5cdf17de1f7dd16d70eb3d145f764a0729088b0f..42c4459b0a4daf7aba5772f3956794629b478c9d 100644 (file)
@@ -80,7 +80,9 @@ namespace MonoTests.System.Linq.Expressions
                        Assert.AreEqual (ExpressionType.OrElse, expr.NodeType, "OrElse#01");
                        Assert.AreEqual (typeof (bool), expr.Type, "OrElse#02");
                        Assert.IsNull (expr.Method, "OrElse#03");
+#if !NET_4_0
                        Assert.AreEqual ("(True || False)", expr.ToString(), "OrElse#04");
+#endif
                }
 
                [Test]
@@ -95,8 +97,10 @@ namespace MonoTests.System.Linq.Expressions
                        Assert.AreEqual (typeof (OpClass), expr.Type, "OrElse#06");
                        Assert.AreEqual (mi, expr.Method, "OrElse#07");
                        Assert.AreEqual ("op_BitwiseOr", expr.Method.Name, "OrElse#08");
+#if !NET_4_0
                        Assert.AreEqual ("(value(MonoTests.System.Linq.Expressions.OpClass) || value(MonoTests.System.Linq.Expressions.OpClass))",
                                expr.ToString(), "OrElse#09");
+#endif
                }
 
                public class BrokenMethod {