Esempio n. 1
0
        public void Distinct()
        {
            var numbers = new[] { 1, 2, 3, 3 };

            Assert.That(MyEnumerable.Distinct(numbers), Is.EquivalentTo(new[] { 1, 2, 3 }));
        }
Esempio n. 2
0
        public void ThrowsWhenSourceIsNull()
        {
            IEnumerable <Int32> numbers = null;

            Assert.Throws <ArgumentNullException>(() => MyEnumerable.Distinct(numbers));
        }
Esempio n. 3
0
        public void DistinctWhenEmpty()
        {
            var numbers = new List <Int32>();

            Assert.That(MyEnumerable.Distinct(numbers), Is.Empty);
        }