add some interesting Call tests, where I got the impl wrong
authorJb Evain <jbevain@gmail.com>
Tue, 26 Feb 2008 21:21:43 +0000 (21:21 -0000)
committerJb Evain <jbevain@gmail.com>
Tue, 26 Feb 2008 21:21:43 +0000 (21:21 -0000)
svn path=/trunk/mcs/; revision=96692

mcs/class/System.Core/Test/System.Linq.Expressions/ExpressionTest_Call.cs

index da082ce6501bdc4396aeb8b8f1dfa2cf613e7371..1b70ac5e528c56d1e1aacaf932a4bbab74a56678 100644 (file)
@@ -172,5 +172,26 @@ namespace MonoTests.System.Linq.Expressions {
                        Assert.AreEqual ("foo", ts ("foo"));
                        Assert.AreEqual ("bar", ts ("bar"));
                }
+
+               [Test]
+               [Category ("NotWorking")]
+               [ExpectedException (typeof (InvalidOperationException))]
+               public void CheckTypeArgsIsNotUsedForParameterLookup ()
+               {
+                       Expression.Call (GetType (), "EineMethod", new [] { typeof (string), typeof (int) }, "foo".ToConstant (), 2.ToConstant ());
+               }
+
+               public static void EineGenericMethod<X, Y> (string foo, int bar)
+               {
+               }
+
+               [Test]
+               [Category ("NotWorking")]
+               public void CheckTypeArgsIsUsedForGenericArguments ()
+               {
+                       var m = Expression.Call (GetType (), "EineGenericMethod", new [] { typeof (string), typeof (int) }, "foo".ToConstant (), 2.ToConstant ());
+                       Assert.IsNotNull (m.Method);
+                       Assert.AreEqual ("Void EineGenericMethod[String,Int32](System.String, Int32)", m.Method.ToString ());
+               }
        }
 }