Skip to content

Commit

Permalink
Move async operation out of synchronous action
Browse files Browse the repository at this point in the history
  • Loading branch information
bash committed Nov 8, 2022
1 parent 1414c52 commit 1ef7acd
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public async Task GivenAnEnumerableNotAMultipleOfSizeWeHaveASmallerLastSlice()

const int chunkSize = 4;
var chunked = numbers.Chunk(chunkSize);
var count = await numbers.CountAsync();

await AsyncAssert.Collection(
chunked,
Expand All @@ -86,9 +87,9 @@ await AsyncAssert.Collection(
{
Assert.Equal(chunkSize, b.Count);
},
async c =>
c =>
{
Assert.Equal(await numbers.CountAsync() % chunkSize, c.Count);
Assert.Equal(count % chunkSize, c.Count);
});
}

Expand Down

0 comments on commit 1ef7acd

Please sign in to comment.