diff --git a/X10D.Tests/src/Text/EnumerableTests.cs b/X10D.Tests/src/Text/EnumerableTests.cs index 540a121..f498f5c 100644 --- a/X10D.Tests/src/Text/EnumerableTests.cs +++ b/X10D.Tests/src/Text/EnumerableTests.cs @@ -44,6 +44,20 @@ public class EnumerableTests Assert.AreEqual(0, actualResult.Length); } + [TestMethod] + public void Grep_ShouldThrowArgumentNullException_GivenNullPattern() + { + IEnumerable source = Enumerable.Empty(); + Assert.ThrowsException(() => source.Grep(null!)); + } + + [TestMethod] + public void Grep_ShouldThrowArgumentNullException_GivenNullSource() + { + IEnumerable source = null!; + Assert.ThrowsException(() => source.Grep("foo")); + } + [TestMethod] public void Grep_ShouldYieldNoElements_GivenNoMatchingStrings() {