CachingEnumerable behaviour #3

Closed
ammachado opened this Issue Oct 28, 2010 · 1 comment

Comments

Projects
None yet
2 participants
Contributor

ammachado commented Oct 28, 2010

How should CachingEnumerable in this situation?

[Fact]
public void Calling_FirstOrDefault_In_CachingEnumerable_Behaviour()
{
    var rows = new CachingEnumerable<Row>(GetRows());
    var row = rows.FirstOrDefault();
    Assert.NotNull(row);

    var rowCount = rows.Count();
    Assert.Equal(2, rowCount);
}

private static IEnumerable<Row> GetRows()
{
    var firstRow = new Row();
    first["field"] = "first";
    yield return firstRow;

    var secondRow = new Row();
    first["field"] = "second";
    yield return secondRow;
}

ammachado closed this Jul 10, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment