public void TestValidIX() { string NumeralValue = ""; NumeralValue = NumeralGenerator.ConvertToArabic("IX"); Assert.IsNotNull(NumeralValue); Assert.AreEqual("9", NumeralValue); }
public void TestValidMCMXCVIII() { string NumeralValue = ""; NumeralValue = NumeralGenerator.ConvertToArabic("MCMXCVIII"); Assert.IsNotNull(NumeralValue); Assert.AreEqual("1998", NumeralValue); }
public void TestM() { string NumeralValue = ""; NumeralValue = NumeralGenerator.ConvertToArabic("M"); Assert.IsNotNull(NumeralValue); Assert.AreEqual("1000", NumeralValue); }
// GET api/values/5 public string Get(string input) { if (NumeralGenerator.DetermineInputType(input) == NumeralGenerator.InputType.Arabic) { return(NumeralGenerator.ConvertToNumeral(input)); } if (NumeralGenerator.DetermineInputType(input) == NumeralGenerator.InputType.Numeral) { return(NumeralGenerator.ConvertToArabic(input)); } return("There was a problem with the controller call."); }