Add MakeBinary test for ArrayIndex expressions
authorJb Evain <jbevain@gmail.com>
Mon, 29 Nov 2010 21:51:38 +0000 (22:51 +0100)
committerJb Evain <jbevain@gmail.com>
Mon, 29 Nov 2010 21:51:55 +0000 (22:51 +0100)
mcs/class/System.Core/Test/System.Linq.Expressions/ExpressionTest_MakeBinary.cs

index ea73b57dd5d467cf8e51cad0055561f8eb9ff7f5..a4114def4c6aa46fb1dd6bd3140bb0811766711a 100644 (file)
@@ -284,5 +284,18 @@ namespace MonoTests.System.Linq.Expressions
 
                }
 
+               [Test]
+               public void MakeArrayIndex ()
+               {
+                       var array = Expression.Constant (new int [] { 1, 2 }, typeof (int []));
+                       var index = Expression.Constant (1);
+
+                       var array_index = Expression.MakeBinary (
+                               ExpressionType.ArrayIndex,
+                               array,
+                               index);
+
+                       Assert.AreEqual (ExpressionType.ArrayIndex, array_index.NodeType);
+               }
        }
 }