Example #1
0
 public void Messages(ErrorCode errorCode, string errorParameter, char argumentId, string expectedMessage)
 {
     var exception = new ArgsException(errorCode, errorParameter, argumentId);
     exception.ErrorMessage().ShouldBe(expectedMessage);
 }
Example #2
0
    public void InvalidArgumentFormatMessage()
    {
        var e = new ArgsException(ErrorCode.InvalidArgumentFormat, "?", 'x');

        Assert.Equal("'?' is not a valid argument format.", e.ErrorMessage());
    }
Example #3
0
    public void UnexpectedMessage()
    {
        var e = new ArgsException(ErrorCode.UnexpectedArgument, null, 'x');

        Assert.Equal("Argument -x unexpected.", e.ErrorMessage());
    }
Example #4
0
    public void InvalidArgumentNameMessage()
    {
        var e = new ArgsException(ErrorCode.InvalidArgumentName, null, 'x');

        Assert.Equal("'x' is not a valid argument name.", e.ErrorMessage());
    }
Example #5
0
    public void MissingDoubleMessage()
    {
        var e = new ArgsException(ErrorCode.MissingDouble, null, 'x');

        Assert.Equal("Could not find double parameter for -x.", e.ErrorMessage());
    }
Example #6
0
    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());
    }