Skip to content

Instantly share code, notes, and snippets.

@pawelpabich
Created December 3, 2013 01:59
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 pawelpabich/7762655 to your computer and use it in GitHub Desktop.
Save pawelpabich/7762655 to your computer and use it in GitHub Desktop.
Custom NSubstitute collection matcher based on the content of the collection. There must be a better way?
private static IEnumerable<int> MatchSingleItemInCollection(int value)
{
return Arg.Is<IEnumerable<int>>(coll => coll.Single() == value);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment