public void FirstOrDefaultNonEmptyListSource() { ListData <int> data = ListData(1, 2, 3); Assert.That(data.FirstOrDefault(), Is.EqualTo(1)); Assert.That(data.IsEnumerated, Is.False); }
public void FirstOrDefaultEmptyListSource() { ListData <object> data = EmptyListData; Assert.That(data.FirstOrDefault(), Is.Null); Assert.That(data.IsEnumerated, Is.False); // # Should not enumerate due to IList optimization }