예제 #1
0
        public void Should_provide_next_for_elements()
        {
            var iter = new[] {8, 2, 5}.Iterator();

            iter.Next().Should().Be(8);
            iter.Next().Should().Be(2);
            iter.Next().Should().Be(5);
        }
예제 #2
0
        public void Should_provide_isempty()
        {
            var iter = new[] { 8, 2}.Iterator();

            iter.Next().Should().Be(8);
            iter.IsEmpty().Should().BeFalse();

            iter.Next().Should().Be(2);
            iter.IsEmpty().Should().BeTrue();
        }
예제 #3
0
        public void Should_provide_vector_of_remaining_elements()
        {
            var iter = new[] { 8, 2, 8, 5, 23 }.Iterator();

            iter.Next().Should().Be(8);
            iter.Next().Should().Be(2);


            var vector = iter.ToVector();
            vector.ShouldBeEquivalentTo(new[] { 8, 5, 23 });
        }