Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }