Esempio n. 1
0
 public void ThrowsWhenOverflowOccurs()
 {
     Assert.Throws <OverflowException>(() => MyEnumerable.Count(GetBigSequence()));
 }
Esempio n. 2
0
        public void CountWhenNotEmpty()
        {
            var numbers = new[] { 1, 2, 3, 4 };

            Assert.That(MyEnumerable.Count(numbers), Is.EqualTo(4));
        }
Esempio n. 3
0
        public void ThrowsWhenSourceIsNull()
        {
            IEnumerable <Int32> numbers = null;

            Assert.Throws <ArgumentNullException>(() => MyEnumerable.Count(numbers));
        }
Esempio n. 4
0
        public void CountWhenEmpty()
        {
            var numbers = new List <Int32>();

            Assert.That(MyEnumerable.Count(numbers), Is.EqualTo(0));
        }