private ValueDependency createLambda() { object lambda = HasOutput ? FuncBuilder.ToFunc(HandlerType, Method) : FuncBuilder.ToAction(HandlerType, Method); return(new ValueDependency(lambda.GetType(), lambda)); }
public void one_in_zero_out() { MethodInfo method = type.GetMethod("OneInZeroOut"); var action = FuncBuilder.ToAction(type, method).ShouldBeOfType <Action <PropertyTarget, string> >(); var target = new PropertyTarget(); action(target, "last name"); target.LastCallToGo.ShouldEqual("last name"); }
protected override IConfiguredInstance buildInstance() { Validate(); var instance = new ConfiguredInstance(determineHandlerType()); var lambda = HasOutput ? FuncBuilder.ToFunc(HandlerType, Method) : FuncBuilder.ToAction(HandlerType, Method); instance.Dependencies.Add(lambda.GetType(), lambda); return(instance); }