linux-packaging-mono/mcs/tests/gtest-etree-31.cs
Xamarin Public Jenkins (auto-signing) e79aa3c0ed Imported Upstream version 4.6.0.125
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
2016-08-03 10:59:49 +00:00

31 lines
622 B
C#

using System;
using System.Linq.Expressions;
class X
{
class HasAction
{
public void Start ()
{
}
}
public static int Main ()
{
var expectedObject = typeof (HasAction).GetMethod("Start");
Expression<Func<HasAction, Action>> methodToUse = r => r.Start;
UnaryExpression unary = methodToUse.Body as UnaryExpression;
MethodCallExpression methodCall = unary.Operand as MethodCallExpression;
ConstantExpression constantExpression = methodCall.Object as ConstantExpression;
if (expectedObject != constantExpression.Value)
return 1;
if (methodCall.Object == null)
return 2;
return 0;
}
}