Navigation Menu

Skip to content

Commit

Permalink
Improve ShouldBeEmpty by implementing it in terms of ShouldMatch.
Browse files Browse the repository at this point in the history
  • Loading branch information
plioi committed Jun 20, 2020
1 parent f7c81a3 commit 3abe088
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Fixie.Tests/Assertions/AssertionExtensions.cs
Expand Up @@ -68,8 +68,7 @@ public static T ShouldBe<T>(this object? actual)

public static void ShouldBeEmpty<T>(this IEnumerable<T> collection)
{
if (collection.Any())
throw new AssertException("Collection was not empty.");
collection.ShouldMatch(Array.Empty<T>());
}

public static TException ShouldThrow<TException>(this Action shouldThrow, string expectedMessage) where TException : Exception
Expand Down

0 comments on commit 3abe088

Please sign in to comment.