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