Example #1
0
        public void CorrectlyReturnAnExceptionForAnUnexpectedArgument()
        {
            var e = new ArgsException(ErrorCodes.UNEXPECTED_ARGUMENT, 'x', null);

            Assert.AreEqual("Argument -x unexpected.", e.errorMessage());
        }
Example #2
0
        public void CorrectlyReturnAnExceptionForAMissingDoubleParameter()
        {
            var e = new ArgsException(ErrorCodes.MISSING_DOUBLE, 'x', null);

            Assert.AreEqual("Could not find a double parameter for -x.", e.errorMessage());
        }
Example #3
0
        public void CorrectlyReturnAnExceptionForAnInvalidDoubleParameter()
        {
            var e = new ArgsException(ErrorCodes.INVALID_DOUBLE, 'x', "Forty two");

            Assert.AreEqual("Argument -x expects a double but was 'Forty two'.", e.errorMessage());
        }
Example #4
0
        public void CorrectlyReturnAnExceptionForAMissingIntegerParameter()
        {
            var e = new ArgsException(ErrorCodes.MISSING_INTEGER, 'x', null);

            Assert.AreEqual("Could not find an integer parameter for -x.", e.errorMessage());
        }
Example #5
0
        public void CorrectlyReturnAnExceptionForAnInvalidIntegerParameter()
        {
            var e = new ArgsException(ErrorCodes.INVALID_INTEGER, 'x', "Forty two");

            Assert.AreEqual("Argument -x expects an integer but was 'Forty two'.", e.errorMessage());
        }
        public void testMissingDoubleMessage()
        {
            ArgsException e = new ArgsException(ErrorCode.MISSING_DOUBLE, 'x', null);

            Assert.Equal("Could not find double parameter for -x.", e.errorMessage());
        }
Example #7
0
        public void CorrectlyReturnAnExceptionForAMissingStringParameter()
        {
            var e = new ArgsException(ErrorCodes.MISSING_STRING, 'x', null);

            Assert.AreEqual("Could not find a string parameter for -x.", e.errorMessage());
        }
        public void testInvalidDoubleMessage()
        {
            ArgsException e = new ArgsException(ErrorCode.INVALID_DOUBLE, 'x', "Forty two");

            Assert.Equal("Argument -x expects a double but was Forty two.", e.errorMessage());
        }
        public void testMissingIntegerMessage()
        {
            ArgsException e = new ArgsException(ErrorCode.MISSING_INTEGER, 'x', null);

            Assert.Equal("Could not find integer parameter for -x.", e.errorMessage());
        }
        public void testInvalidIntegerMessage()
        {
            ArgsException e = new ArgsException(ErrorCode.INVALID_INTEGER, 'x', "Forty two");

            Assert.Equal("Argument -x expects an integer but was Forty two.", e.errorMessage());
        }
        public void testMissingStringMessage()
        {
            ArgsException e = new ArgsException(ErrorCode.MISSING_STRING, 'x', null);

            Assert.Equal("Could not find string parameter for -x.", e.errorMessage());
        }
        public void testUnexpectedMessage()
        {
            ArgsException e = new ArgsException(ErrorCode.UNEXPECTED_ARGUMENT, 'x', null);

            Assert.Equal("Argument -x unexpected.", e.errorMessage());
        }