Skip to content

Commit

Permalink
Unit test cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jroland committed Apr 5, 2015
1 parent d3dcc04 commit 92b3988
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/kafka-tests/Unit/NagleBlockingCollectionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public void TakeAsyncShouldPlayNiceWithTPL()

dataTask.ContinueWith(x => exit = true);

Parallel.ForEach(Enumerable.Range(0, max),
Parallel.ForEach(Enumerable.Range(0, max).ToList(),
new ParallelOptions { MaxDegreeOfParallelism = 20 },
async x =>
{
Expand Down Expand Up @@ -228,7 +228,7 @@ public void TakeAsyncShouldBeThreadSafe()
take3.ContinueWith(t => Console.WriteLine("Take3 done..."));
Task.WhenAll(take1, take2, take3).ContinueWith(x => exit = true);

Parallel.ForEach(Enumerable.Range(0, max),
Parallel.ForEach(Enumerable.Range(0, max).ToList(),
new ParallelOptions { MaxDegreeOfParallelism = 20 },
async x =>
{
Expand Down
3 changes: 2 additions & 1 deletion src/kafka-tests/Unit/ProducerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ public void ProducerShouldReportCorrectAmountOfAsyncRequests()
semaphore.Release();
sendTask.Wait(TimeSpan.FromMilliseconds(500));

Assert.That(producer.AsyncCount, Is.EqualTo(0), "Async should have completed.");
Assert.That(sendTask.IsCompleted, Is.True, "Send task should be marked as completed.");
Assert.That(producer.AsyncCount, Is.EqualTo(0), "Async should now show zero count.");
}
}

Expand Down

0 comments on commit 92b3988

Please sign in to comment.