Skip to content

Commit 5b5cc83

Browse files
committed
Strengthen tests for ArgumentNullException
1 parent 80064a6 commit 5b5cc83

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/Log4NetTextFormatterOptionsBuilderTest.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ public void SettingPropertyFilterToNullThrowsArgumentNullException()
104104

105105
// Assert
106106
action.Should().ThrowExactly<ArgumentNullException>()
107-
.Which.Message.Should().StartWith("The FilterProperty option can not be null.");
107+
.WithMessage("The FilterProperty option can not be null.*")
108+
.And.ParamName.Should().Be("filterProperty");
108109
}
109110

110111
[Fact]
@@ -144,7 +145,8 @@ public void SettingExceptionFormatterToNullThrowsArgumentNullException()
144145

145146
// Assert
146147
action.Should().ThrowExactly<ArgumentNullException>()
147-
.Which.Message.Should().StartWith("The FormatException option can not be null.");
148+
.WithMessage("The FormatException option can not be null.*")
149+
.And.ParamName.Should().Be("formatException");
148150
}
149151
}
150152
}

0 commit comments

Comments
 (0)