public void Messages(ErrorCode errorCode, string errorParameter, char argumentId, string expectedMessage) { var exception = new ArgsException(errorCode, errorParameter, argumentId); exception.ErrorMessage().ShouldBe(expectedMessage); }
public void InvalidArgumentFormatMessage() { var e = new ArgsException(ErrorCode.InvalidArgumentFormat, "?", 'x'); Assert.Equal("'?' is not a valid argument format.", e.ErrorMessage()); }
public void UnexpectedMessage() { var e = new ArgsException(ErrorCode.UnexpectedArgument, null, 'x'); Assert.Equal("Argument -x unexpected.", e.ErrorMessage()); }
public void InvalidArgumentNameMessage() { var e = new ArgsException(ErrorCode.InvalidArgumentName, null, 'x'); Assert.Equal("'x' is not a valid argument name.", e.ErrorMessage()); }
public void MissingDoubleMessage() { var e = new ArgsException(ErrorCode.MissingDouble, null, 'x'); Assert.Equal("Could not find double parameter for -x.", e.ErrorMessage()); }
public void InvalidDoubleMessage() { var e = new ArgsException(ErrorCode.InvalidDouble, "Forty two", 'x'); Assert.Equal("Argument -x expects a double but was 'Forty two'.", e.ErrorMessage()); }