Example #1
0
            public void SortedEnumerable_ReturnWithDelegate_EnumeratesSingleItem()
            {
                int source = 13;
                ISortedEnumerable <int> result = SortedEnumerableSource.Return(source, (x, y) => Comparer <int> .Default.Compare(y, x));

                Assert.IsTrue(result.SequenceEqual(new[] { 13 }), "Item should be enumerated.");
            }
Example #2
0
            public void SortedEnumerable_Return_EnumeratesSingleItem()
            {
                int source = 13;
                ISortedEnumerable <int> result = SortedEnumerableSource.Return(source);

                Assert.IsTrue(result.SequenceEqual(new[] { 13 }), "Item should be enumerated.");
            }
Example #3
0
            public void SortedEnumerable_ReturnWithComparer_RemembersComparer()
            {
                var comparer = Comparer <int> .Default;
                int source   = 13;
                ISortedEnumerable <int> result = SortedEnumerableSource.Return(source, Comparer <int> .Default);

                Assert.AreEqual(comparer, result.Comparer, "Comparer should be remembered.");
            }