예제 #1
0
        public void LambdaWith2ParametersCanBeCurried()
        {
            var curriedLambda = FunctionExtensions.Curry((int v1, string v2) => Tuple.Create(v1, v2));

            var result = curriedLambda(5)("five");

            Assert.Equal(Tuple.Create(5, "five"), result);
        }
예제 #2
0
        public void StaticMethodWith2ParametersCanBeCurried()
        {
            var curriedMethod = FunctionExtensions
                                .Curry <int, string, object>(MethodWithTwoParameters);

            var result = curriedMethod(5)("five");

            Assert.Equal(Tuple.Create(5, "five"), result);
        }
예제 #3
0
        public void DelegateWith2ParametersCanBeCurried()
        {
            var curriedDelegate = FunctionExtensions
                                  .Curry <int, string, object>(DelegateWithTwoParamaters.Invoke);

            var result = curriedDelegate(5)("five");

            Assert.Equal(Tuple.Create(5, "five"), result);
        }