Exemplo n.º 1
0
        public void LastOrDefaultNonEmptyListSource()
        {
            ListData <int> data = ListData(1, 2, 3);

            Assert.That(data.LastOrDefault(), Is.EqualTo(3));
            Assert.That(data.IsEnumerated, Is.False);
        }
Exemplo n.º 2
0
        public void LastOrDefaultEmptyListSource()
        {
            ListData <object> data = EmptyListData;

            Assert.That(data.LastOrDefault(), Is.Null);
            Assert.That(data.IsEnumerated, Is.False); // # Should not enumerate due to IList optimization
        }