public void testCountPipeZero() { var _List = new List<String>(); var _Pipe = new CountPipe<String>(); _Pipe.SetSourceCollection(_List); while (_Pipe.MoveNext()) { } Assert.AreEqual(0UL, _Pipe.SideEffect); }
public void testCountPipeNormal() { var _List = new List<String>() { "marko", "antonio", "rodriguez", "was", "here", "." }; var _Pipe = new CountPipe<String>(); _Pipe.SetSourceCollection(_List); var _Counter = 0UL; while (_Pipe.MoveNext()) { var s = _Pipe.Current; Assert.IsTrue(s.Equals("marko") || s.Equals("antonio") || s.Equals("rodriguez") || s.Equals("was") || s.Equals("here") || s.Equals(".")); _Counter++; Assert.AreEqual(_Counter, _Pipe.SideEffect); } Assert.AreEqual(6UL, _Pipe.SideEffect); }