public void testFuncPipeNormal() { var _Numbers = Enumerable.Range(1, 10); var _Pipe = new FuncPipe<Int32, String>((_Int32) => (_Int32 * _Int32).ToString()); _Pipe.SetSourceCollection(_Numbers); var _Counter = 0; while (_Pipe.MoveNext()) { Assert.AreEqual(_Pipe.Current , (_Numbers.ElementAt(_Counter) * _Numbers.ElementAt(_Counter)).ToString()); _Counter++; } Assert.AreEqual(_Counter, 10); }
public void testDualFuncPipeNormal() { var _Strings = new List<String>() { "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten" }; var _Numbers = Enumerable.Range(1, 10); var _Pipe = new FuncPipe<String, Int32, String>((A, B) => A + "-" + B); _Pipe.SetSourceCollection1(_Strings); _Pipe.SetSourceCollection2(_Numbers); var _Counter = 0; while (_Pipe.MoveNext()) { Assert.AreEqual(_Pipe.Current, _Strings.ElementAt(_Counter) + "-" + _Numbers.ElementAt(_Counter)); _Counter++; } Assert.AreEqual(_Counter, 10); }