Example #1
0
        public void Empty()
        {
            var enumerable = ValueEnumerable.Empty <int>();

            Assert.AreEqual(0, enumerable.Count);
            Assert.AreEqual(0, enumerable.Count());
        }
Example #2
0
        public int Hyperlinq_Empty()
        {
            var sum = 0;

            foreach (var item in ValueEnumerable.Empty <int>())
            {
                sum += item;
            }
            return(sum);
        }
Example #3
0
        public int Hyperlinq_Empty_Select_ForEach()
        {
            var sum = 0;

            foreach (var item in ValueEnumerable.Empty <int>().Select(item => item))
            {
                sum += item;
            }
            return(sum);
        }
Example #4
0
        public int Hyperlinq_Empty_Where_ForEach()
        {
            var sum = 0;

            foreach (var item in ValueEnumerable.Empty <int>().Where(item => (item & 0x01) == 0))
            {
                sum += item;
            }
            return(sum);
        }
Example #5
0
        public int Hyperlinq_Empty_Select_For()
        {
            var source = ValueEnumerable.Empty <int>().Select(item => item);
            var sum    = 0;

            for (var index = 0; index < source.Count(); index++)
            {
                sum += source[index];
            }
            return(sum);
        }
Example #6
0
        public void Empty_Must_Succeed()
        {
            // Arrange
            var expected = Enumerable.Empty <int>();

            // Act
            var result = ValueEnumerable.Empty <int>();

            // Assert
            _ = result.Must()
                .BeEnumerableOf <int>()
                .BeEqualTo(expected);
        }
Example #7
0
 public int Hyperlinq_Empty_Count()
 => ValueEnumerable.Empty <int>().Count();