dennisdoomen/fluentassertions — pull request #186 by abatishchev (2014-11-26 21:10:37+00:00)
Title: Adding an overload of ContainSingle() without arguments

Adding to SelfReferencingCollectionAssertions an overload of ContainSingle() with no meaningful arguments meaning the collection has only 1 item:

public AndConstraint ContainSingle(string because = "", params object[] reasonArgs)

It's useful in a case when method in the real code returns a collection (e.g. `IEnumerable`) but in the test just a single item.

Currently it looks like this:

actual.Should().ContainSingle(x => x == expected);

or

actual.Should().HaveCount(1);

but is more explicit and readable (imo).