VelocityInvokeMemberBinder does not work with ExpandoObject. This is because ExpandoObject works by a GetMember operation, followed by an Invoke on the retrieved member. This fails because FallbackInvoke is not implemented in VelocityInvokeMemberBinder .
In FallbackInvoke, the target should be a delegate (Func, Action, custom deletage), which should be invoked with the given arguments (provided they're compatible)
public void ShouldInvokeMemberOnDynamicObject()
{
dynamic input = new ExpandoObject();
input.Double = new Func<int,int>(x => x * 2);
var result = test(input, "Double", 123);
Assert.That(result, Is.EqualTo(246));
}
VelocityInvokeMemberBinder does not work with ExpandoObject. This is because ExpandoObject works by a
GetMember
operation, followed by anInvoke
on the retrieved member. This fails because FallbackInvoke is not implemented in VelocityInvokeMemberBinder .In FallbackInvoke, the target should be a delegate (Func, Action, custom deletage), which should be invoked with the given arguments (provided they're compatible)
Related to #45.