public virtual void TestAll1() { IEnumerator <string> it = new FilterEnumerator <string>(set.GetEnumerator(), (s) => true); Assert.IsTrue(it.MoveNext()); Assert.AreEqual("a", it.Current); Assert.IsTrue(it.MoveNext()); Assert.AreEqual("b", it.Current); Assert.IsTrue(it.MoveNext()); Assert.AreEqual("c", it.Current); AssertNoMore(it); }
public virtual void TestB1() { IEnumerator <string> it = new FilterEnumerator <string>(set.GetEnumerator(), (s) => "b".Equals(s, StringComparison.Ordinal)); Assert.IsTrue(it.MoveNext()); Assert.AreEqual("b", it.Current); AssertNoMore(it); }
public virtual void TestA2() { IEnumerator <string> it = new FilterEnumerator <string>(set.GetEnumerator(), (s) => "a".Equals(s, StringComparison.Ordinal)); // this time without check: Assert.IsTrue(it.hasNext()); it.MoveNext(); Assert.AreEqual("a", it.Current); AssertNoMore(it); }