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)); }
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); }
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(); }
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(); }