Esempio n. 1
0
        public void ConverterTest_RomanNumeral_Digit(string input, int expectedOutput)
        {
            var converter = new RomanNumeralToDigitConverter();

            var actualOutput = converter.Convert(input);

            Assert.AreEqual(expectedOutput, actualOutput);
        }
 public IActionResult ConvertRomanNumeralToDigit(string input)
 {
     try
     {
         var digit = _romanNumeralToDigitConverter.Convert(input);
         return(Ok(digit));
     }
     catch (InvalidInputException exception)
     {
         return(BadRequest(exception.Message));
     }
 }
Esempio n. 3
0
        public void ConverterTest_InvalidRomanNumeral_InvalidInputException(string input)
        {
            var converter = new RomanNumeralToDigitConverter();

            Assert.Throws <InvalidInputException>(() => converter.Convert(input));
        }