public void testFuncFilterPipeTrue() { var _Numbers = Enumerable.Range(1, 10); // Even or odd? var _Pipe = new FuncFilterPipe<Int32>((_Int32) => true); _Pipe.SetSourceCollection(_Numbers); var _Counter = 0; while (_Pipe.MoveNext()) { _Counter++; } Assert.AreEqual(_Counter, 0); }
public void testFuncFilterPipeNormal() { var _Numbers = Enumerable.Range(1, 10); // Even or odd? var _Pipe = new FuncFilterPipe<Int32>((_Int32) => ((_Int32 & 0x1) != 0) ? true : false); _Pipe.SetSourceCollection(_Numbers); var _Counter = 0; while (_Pipe.MoveNext()) { Assert.IsTrue((_Pipe.Current & 0x01) == 0); _Counter++; } Assert.AreEqual(_Counter, 5); }