예제 #1
0
        private ValueDependency createLambda()
        {
            object lambda = HasOutput
                                ? FuncBuilder.ToFunc(HandlerType, Method)
                                : FuncBuilder.ToAction(HandlerType, Method);

            return(new ValueDependency(lambda.GetType(), lambda));
        }
예제 #2
0
        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");
        }
예제 #3
0
        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);
        }