Beispiel #1
0
        public async Threading.Tasks.Task GetCountAsync()
        {
            var array = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 };
            var act   = new TestEnumerable <int>(array).ToAsyncEnumerable();

            (await(act as IAsyncIListProvider <int>).GetCountAsync(false, CancellationToken.None)).ShouldBe(8);
        }
Beispiel #2
0
        public async Threading.Tasks.Task ToArrayAsync()
        {
            var array = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 };
            var act   = new TestEnumerable <int>(array).ToAsyncEnumerable();
            var list  = await(act as IAsyncIListProvider <int>).ToArrayAsync(CancellationToken.None);

            list.SequenceEqual(array).ShouldBeTrue();
        }
Beispiel #3
0
        public async Task ForEachAsync_1()
        {
            var array = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 };
            var act   = new TestEnumerable <int>(array).ToAsyncEnumerable();
            var exp   = new List <int>();
            await act.ForEachAsync(v => exp.Add(v));

            exp.SequenceEqual(array).ShouldBeTrue();
        }