public void TestValid1998()
        {
            string NumeralValue = "";

            NumeralValue = NumeralGenerator.ConvertToNumeral("1998");
            Assert.IsNotNull(NumeralValue);
            Assert.AreEqual("MCMXCVIII", NumeralValue);
        }
        public void TestValidMMXLIX()
        {
            string NumeralValue = "";

            NumeralValue = NumeralGenerator.ConvertToNumeral("2049");
            Assert.IsNotNull(NumeralValue);
            Assert.AreEqual("MMXLIX", NumeralValue);
        }
        public void TestValid4()
        {
            string NumeralValue = "";

            NumeralValue = NumeralGenerator.ConvertToNumeral("4");
            Assert.IsNotNull(NumeralValue);
            Assert.AreEqual("IV", NumeralValue);
        }
        public void TestValid179()
        {
            string NumeralValue = "";

            NumeralValue = NumeralGenerator.ConvertToNumeral("179");
            Assert.IsNotNull(NumeralValue);
            Assert.AreEqual("CLXXIX", NumeralValue);
        }
Example #5
0
        public void TestM()
        {
            string NumeralValue = "";

            NumeralValue = NumeralGenerator.ConvertToArabic("M");
            Assert.IsNotNull(NumeralValue);
            Assert.AreEqual("1000", NumeralValue);
        }
Example #6
0
        public void TestValidIX()
        {
            string NumeralValue = "";

            NumeralValue = NumeralGenerator.ConvertToArabic("IX");
            Assert.IsNotNull(NumeralValue);
            Assert.AreEqual("9", NumeralValue);
        }
Example #7
0
    public void ToNumeral(int number, string expected)
    {
        var sw     = Stopwatch.StartNew();
        var actual = NumeralGenerator.ToNumeral(number);

        sw.Stop();
        _output.WriteLine(sw.ElapsedMilliseconds.ToString());
        Assert.Equal(expected, actual);
    }
Example #8
0
        // 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.");
        }
Example #9
0
 public void TestNumeralcSpace()
 {
     NumeralGenerator.InputType result = NumeralGenerator.InputType.Error;
     Assert.AreEqual(result, NumeralGenerator.DetermineInputType("DLIV IX"));
 }
Example #10
0
 public void TestNumeralSymbol()
 {
     NumeralGenerator.InputType result = NumeralGenerator.InputType.Error;
     Assert.AreEqual(result, NumeralGenerator.DetermineInputType("IVX*I"));
 }
Example #11
0
 public void TestNumeralNegative()
 {
     NumeralGenerator.InputType result = NumeralGenerator.InputType.Error;
     Assert.AreEqual(result, NumeralGenerator.DetermineInputType("XVI-9DCL"));
 }
Example #12
0
 public void TestNArabicSymbol()
 {
     NumeralGenerator.InputType result = NumeralGenerator.InputType.Error;
     Assert.AreEqual(result, NumeralGenerator.DetermineInputType("234#343"));
 }
Example #13
0
 public void TestArabicNegative()
 {
     NumeralGenerator.InputType result = NumeralGenerator.InputType.Error;
     Assert.AreEqual(result, NumeralGenerator.DetermineInputType("345-5234"));
 }
Example #14
0
 public void TestEmpty()
 {
     NumeralGenerator.InputType result = NumeralGenerator.InputType.Error;
     Assert.AreEqual(result, NumeralGenerator.DetermineInputType(""));
 }