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