You've already forked linux-packaging-mono
Imported Upstream version 4.6.0.125
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
This commit is contained in:
parent
a569aebcfd
commit
e79aa3c0ed
31
mcs/tests/gtest-etree-31.cs
Normal file
31
mcs/tests/gtest-etree-31.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user