Beispiel #1
0
        public void LastEmptyListSource()
        {
            ListData <object> data = EmptyListData;

            Assert.Throws <InvalidOperationException>(() => data.Last()).WithMessageNoElements();
            Assert.That(data.IsEnumerated, Is.False); // # Should not enumerate due to IList optimization
        }
Beispiel #2
0
        public void LastNonEmptyListSource()
        {
            ListData <int> data = ListData(1, 2, 3);

            Assert.That(data.Last(), Is.EqualTo(3));
            Assert.That(data.IsEnumerated, Is.False);
        }