public void Should_Not_Throw_If_ParamName_Is_The_Same(string actualParamName, string expectedParamName) { // Given var exception = new ArgumentNullException(actualParamName); // When exception.IsArgumentNullException(expectedParamName); // Then }
public void Should_Not_Throw_If_Exception_Type_Is_ArgumentNullException() { // Given var exception = new ArgumentNullException("Foo"); // When exception.IsArgumentNullException("Foo"); // Then }
public void Should_Throw_If_ParamName_Is_Different(string actualParamName, string expectedParamName) { // Given var exception = new ArgumentNullException(actualParamName); // When var result = Record.Exception(() => exception.IsArgumentNullException(expectedParamName)); // Then result.ShouldBeOfType <Exception>(); result.Message.ShouldBe($"Expected parameter name to be '{expectedParamName}' but was '{actualParamName}'."); }