public void testCountCombinePipeZero() { var _Names = new List<String>(); var _Pipe = new GroupCountPipe<String>(); _Pipe.SetSourceCollection(_Names); Assert.IsFalse(_Pipe.MoveNext()); Assert.IsFalse(_Pipe.SideEffect.ContainsKey("povel")); }
public void testCountCombinePipeNormal() { var _Names = new List<String>() { "marko", "josh", "peter", "peter", "peter", "josh" }; var _Pipe = new GroupCountPipe<String>(); _Pipe.SetSourceCollection(_Names); var _Counter = 0; foreach (var name in _Pipe) { Assert.IsTrue(name.Equals("marko") || name.Equals("josh") || name.Equals("peter")); _Counter++; } Assert.AreEqual(6UL, _Counter); Assert.AreEqual(1UL, _Pipe.SideEffect["marko"]); Assert.AreEqual(2UL, _Pipe.SideEffect["josh"]); Assert.AreEqual(3UL, _Pipe.SideEffect["peter"]); Assert.IsFalse(_Pipe.SideEffect.ContainsKey("povel")); }