public async Task AllThrowsArgumentNullExceptionWhenSourceIsNull()
        {
            IAsyncEnumerable <int> source = null;

            source.ShouldBeNull();

            await source.AllAsync(x => x % 2 == 0).ShouldThrowAsync <bool, ArgumentNullException>();
        }
示例#2
0
 private static async Task CheckPosts(PostsSearchQuery postsSearchQuery, IAsyncEnumerable <IPost> posts)
 {
     Assert.True(postsSearchQuery.MaximumResults >= await posts.CountAsync());
     Assert.True(await posts.AllAsync(post => post.CreatedAt >= postsSearchQuery.Since));
 }
示例#3
0
 private async Task CheckPostsAuthor(IAsyncEnumerable <IPost> posts, IUser author)
 {
     Assert.True(
         await posts
         .AllAsync(post => post.Author.Id == author.Id));
 }