public IObjectGenerator <T> Invoke <TMember>(System.Linq.Expressions.Expression <Func <T, TMember> > methodExpr) { ObjectMethodInvokeFuncAction <T, TMember> invoker = new ObjectMethodInvokeFuncAction <T, TMember>(methodExpr.Compile()); mOverrides.Add(invoker); return(this); }
public void Enact_CallsFunc() { ObjectMethodInvokeFuncAction<SimpleMethodClass, String> action = new ObjectMethodInvokeFuncAction<SimpleMethodClass, String>(x => x.ReturnSomething()); SimpleMethodClass target = new SimpleMethodClass(); action.Enact(null, target); Assert.True(target.ReturnSomethingCalled); }
public void Enact_CallsFunc() { ObjectMethodInvokeFuncAction <SimpleMethodClass, String> action = new ObjectMethodInvokeFuncAction <SimpleMethodClass, String>(x => x.ReturnSomething()); SimpleMethodClass target = new SimpleMethodClass(); action.Enact(null, target); Assert.True(target.ReturnSomethingCalled); }