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

            source.ShouldBeNull();

            await source.AllAsync(x => x % 2 == 0).ShouldThrowAsync <bool, ArgumentNullException>();
        }
Esempio n. 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));
 }
Esempio n. 3
0
 private async Task CheckPostsAuthor(IAsyncEnumerable <IPost> posts, IUser author)
 {
     Assert.True(
         await posts
         .AllAsync(post => post.Author.Id == author.Id));
 }