Ejemplo n.º 1
0
        public void Cond_Forwards_All_Arguments_To_Predicates_And_To_Transformers()
        {
            var fn = R.Cond(new object[] {
                new object[] { Currying.Delegate((object[] arguments) => (int)arguments[1] == 42), Currying.Delegate((object[] arguments) => arguments.Length) }
            });

            Assert.AreEqual(fn(new[] { 21, 42, 84 }), 3);
        }
Ejemplo n.º 2
0
        public void Converge_Works_With_Empty_Functions_List()
        {
            dynamic @delegate = Currying.Delegate(arguments => arguments.Length);
            var     fn        = R.Converge(@delegate, new Delegate[0]);

            Assert.AreEqual(fn.Length, 0);
            Assert.AreEqual(fn(), 0);
        }