Exemplo n.º 1
0
        public void when_at_the_end_both_current_and_next_are_default()
        {
            LookAheadEnumerator <char> testing = CreateEnumerator("a");

            Assert.IsTrue(testing.MoveNext());
            Assert.IsFalse(testing.MoveNext());
            Assert.AreEqual(default(char), testing.Current, "Current");
            Assert.AreEqual(default(char), testing.Next, "Next");
        }
Exemplo n.º 2
0
        public void can_move_to_second_item()
        {
            LookAheadEnumerator <char> testing = CreateEnumerator("abc");

            Assert.IsTrue(testing.MoveNext());
            Assert.IsTrue(testing.MoveNext());
            Assert.AreEqual('b', testing.Current, "Current");
            Assert.AreEqual('c', testing.Next, "Next");
        }
Exemplo n.º 3
0
        public void when_moving_to_last_entry_next_is_default()
        {
            LookAheadEnumerator <char> testing = CreateEnumerator("a");

            Assert.IsTrue(testing.MoveNext());
            Assert.AreEqual('a', testing.Current, "Current");
            Assert.AreEqual(default(char), testing.Next, "Next");
        }
Exemplo n.º 4
0
        public void calling_movenext_sets_current_and_next()
        {
            LookAheadEnumerator <char> testing = CreateEnumerator("abc");

            Assert.IsTrue(testing.MoveNext());
            Assert.AreEqual('a', testing.Current, "Current");
            Assert.AreEqual('b', testing.Next, "Next");
        }