I'm finding myself needing a lot of this sort of logic lately:
Assert.That(collection.Items, Has.Member(expected_item));
Assert.That(collection.Items.Count(), Is.EqualTo(1));
I see that NUnit offers Has.Some
and Has.All
, but I don't see anything like Has.One
. What's the best way to accomplish this without two asserts?