Esempio n. 1
0
        public void TestProcess()
        {
            var expected = new[] { 1, 2, 3, 4, 5 };
            var p1       = Process.Apply(1, 2, 3, 4, 5);
            var result   = p1.RunLog();

            Assert.IsTrue(TestUtils.AreEqual(expected, result));
        }
Esempio n. 2
0
        public void TestSelectMany()
        {
            var p1      = Process.Apply(1);
            var p2      = Process.Apply(2);
            var p3      = p1.SelectMany(n => p2);
            var results = p3.RunLog();

            results.ForEach(Console.WriteLine);
        }
Esempio n. 3
0
        public void TestTee()
        {
            var p1 = Process.Apply(1, 2, 3, 4, 5).Select(n => n.ToString());
            var p2 = Process.Apply("a", "b", "c", "d", "e");
            var p3 = Process.Interleave(p1, p2);
            var p4 = Process.Sink <string>(s => Console.WriteLine(s));

            var results = p3.Pipe(p4).Run();
        }
Esempio n. 4
0
        public void TestSink()
        {
            var p1 = Process.Apply(1, 2, 3, 4, 5);
            var p2 = Process.Lift1 <int, Unit>(n => { Console.WriteLine(n); return(Unit.Only); });
            var p3 = p2.Concat(() => p2);
            var p4 = p1.Pipe(p3);

            p4.Run();
        }