Author: jbevain
Date: 2008-01-29 11:13:11 -0500 (Tue, 29 Jan 2008)
New Revision: 94258
Modified:
trunk/mcs/class/System.Core/Test/System.Linq.Expressions/ExpressionTest_CallWithExpression.cs
Log:
add tests for call arguments
Modified:
trunk/mcs/class/System.Core/Test/System.Linq.Expressions/ExpressionTest_CallWithExpression.cs
===================================================================
---
trunk/mcs/class/System.Core/Test/System.Linq.Expressions/ExpressionTest_CallWithExpression.cs
2008-01-29 16:01:39 UTC (rev 94257)
+++
trunk/mcs/class/System.Core/Test/System.Linq.Expressions/ExpressionTest_CallWithExpression.cs
2008-01-29 16:13:11 UTC (rev 94258)
@@ -66,7 +66,27 @@
Expression.Call (Expression.Constant (new object ()),
typeof (object).GetMethod ("ToString"), Expression.Constant (new object ()));
}
+ public class Foo {
+ public void Bar (string s)
+ {
+ }
+ }
+
[Test]
+ [ExpectedException (typeof (ArgumentNullException))]
+ public void MethodHasNullArgument ()
+ {
+ Expression.Call (Expression.New (typeof (Foo)), typeof
(Foo).GetMethod ("Bar"), null as Expression);
+ }
+
+ [Test]
+ [ExpectedException (typeof (ArgumentException))]
+ public void MethodArgumentDoesntMatchParameterType ()
+ {
+ Expression.Call (Expression.New (typeof (Foo)), typeof
(Foo).GetMethod ("Bar"), Expression.Constant (42));
+ }
+
+ [Test]
public void CallToString ()
{
var call = Expression.Call (Expression.Constant (new
object ()), typeof (object).GetMethod ("ToString"));
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches