Ejemplo n.º 1
0
        public void Select_Test()
        {
            var source = new ListSequence <int>(
                new[] { 1, 2, 3 },
                0
                );
            var target = source.Select(x => x * 2);

            target.GetNext().Should().Be(2);
            target.GetNext().Should().Be(4);
            target.GetNext().Should().Be(6);
            target.GetNext().Should().Be(0);
        }
Ejemplo n.º 2
0
        public void IsAtEnd_Test()
        {
            var source = new ListSequence <int>(
                new[] { 1, 2, 3 },
                0
                );
            var target = source.Select(x => x * 2);

            target.IsAtEnd.Should().BeFalse();
            target.GetNext().Should().Be(2);
            target.IsAtEnd.Should().BeFalse();
            target.GetNext().Should().Be(4);
            target.IsAtEnd.Should().BeFalse();
            target.GetNext().Should().Be(6);
            target.IsAtEnd.Should().BeTrue();
        }