Skip to content

Instantly share code, notes, and snippets.

@rofr
Created June 25, 2017 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rofr/ae40fbe41e3475cd7a977d542314b909 to your computer and use it in GitHub Desktop.
Save rofr/ae40fbe41e3475cd7a977d542314b909 to your computer and use it in GitHub Desktop.
testing assumptions on framework behavior
[Fact]
public void TryTake_returns_false_when_marked_for_completion()
{
var blockingCollection = new BlockingCollection<int>();
blockingCollection.CompleteAdding();
var result = blockingCollection.TryTake(out var item);
Assert.False(result);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment