// 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."); }
public void TestNumeralcSpace() { NumeralGenerator.InputType result = NumeralGenerator.InputType.Error; Assert.AreEqual(result, NumeralGenerator.DetermineInputType("DLIV IX")); }
public void TestNumeralSymbol() { NumeralGenerator.InputType result = NumeralGenerator.InputType.Error; Assert.AreEqual(result, NumeralGenerator.DetermineInputType("IVX*I")); }
public void TestNumeralNegative() { NumeralGenerator.InputType result = NumeralGenerator.InputType.Error; Assert.AreEqual(result, NumeralGenerator.DetermineInputType("XVI-9DCL")); }
public void TestNArabicSymbol() { NumeralGenerator.InputType result = NumeralGenerator.InputType.Error; Assert.AreEqual(result, NumeralGenerator.DetermineInputType("234#343")); }
public void TestArabicNegative() { NumeralGenerator.InputType result = NumeralGenerator.InputType.Error; Assert.AreEqual(result, NumeralGenerator.DetermineInputType("345-5234")); }
public void TestEmpty() { NumeralGenerator.InputType result = NumeralGenerator.InputType.Error; Assert.AreEqual(result, NumeralGenerator.DetermineInputType("")); }