示例#1
0
        public void SelectWhenNotEmpty()
        {
            var numbers = new[] { 1, 2, 3 };

            Assert.That(MyEnumerable.Select(numbers, n => n + 1), Is.EquivalentTo(new[] { 2, 3, 4 }));
        }
示例#2
0
        public void ThrowsWhenSourceIsNull()
        {
            IEnumerable <Int32> numbers = null;

            Assert.Throws <ArgumentNullException>(() => MyEnumerable.Select(numbers, n => n + 1));
        }
示例#3
0
        public void SelectWhenEmpty()
        {
            var numbers = new List <Int32>();

            Assert.That(MyEnumerable.Select(numbers, n => n), Is.Empty);
        }