Example #1
0
        public void RomanToArabic_InputCMRomanNumberal_Returns900()
        {
            ConvertingLogic number  = new ConvertingLogic();
            string          romanCM = "CM";

            int result = number.RomanToArabic(romanCM);

            Assert.That(result, Is.EqualTo(900));
        }
Example #2
0
        public void RomanToArabic_InputMLIXRomanNumberal_Returns1059()
        {
            ConvertingLogic number    = new ConvertingLogic();
            string          romanMLIX = "MLIX";

            int result = number.RomanToArabic(romanMLIX);

            Assert.That(result, Is.EqualTo(1059));
        }
Example #3
0
        public void RomanToArabic_InputIVRomanNumberal_Returns4()
        {
            ConvertingLogic number  = new ConvertingLogic();
            string          romanIV = "IV";

            int result = number.RomanToArabic(romanIV);

            Assert.That(result, Is.EqualTo(4));
        }
Example #4
0
        public void RomanToArabic_InputVIIIRomanNumberal_Returns8()
        {
            ConvertingLogic number    = new ConvertingLogic();
            string          romanVIII = "VIII";

            int result = number.RomanToArabic(romanVIII);

            Assert.That(result, Is.EqualTo(8));
        }
Example #5
0
        public void ArabicToRoman_Input1059ArabicNumber_ReturnsMLIX()
        {
            ConvertingLogic number     = new ConvertingLogic();
            int             arabic1059 = 1059;

            string result = number.ArabicToRoman(arabic1059);

            Assert.That(result, Is.EqualTo("MLIX"));
        }
Example #6
0
        public void ArabicToRoman_Input900ArabicNumber_ReturnsCM()
        {
            ConvertingLogic number    = new ConvertingLogic();
            int             arabic900 = 900;

            string result = number.ArabicToRoman(arabic900);

            Assert.That(result, Is.EqualTo("CM"));
        }
Example #7
0
        public void ArabicToRoman_Input8ArabicNumber_ReturnsVIII()
        {
            ConvertingLogic number  = new ConvertingLogic();
            int             arabic8 = 8;

            string result = number.ArabicToRoman(arabic8);

            Assert.That(result, Is.EqualTo("VIII"));
        }
Example #8
0
        public void ArabicToRoman_Input4ArabicNumber_ReturnsIV()
        {
            ConvertingLogic number  = new ConvertingLogic();
            int             arabic4 = 4;

            string result = number.ArabicToRoman(arabic4);

            Assert.That(result, Is.EqualTo("IV"));
        }
Example #9
0
        public static void Main(string[] args)
        {
            Console.WriteLine("Enter numeric value less than or equal to 99,999 only. No alphabets.");
            var inputField = Console.ReadLine();

            if (inputField.ToString().Length > 5)
            {
                Console.WriteLine("Enter value less than 5, means conversion is implemented till 99,999 only.");
                //We can implement it, but pdf asked till 10 thousand. We will need to go on adding conditions in implemented class.
                //Right now, it is assumed that, user will enter only NUMERIC fields and not alphabets.
                Console.WriteLine("Enter once Again:");
                inputField = Console.ReadLine();
            }
            Console.WriteLine("\n" + inputField + " is splelled as:" + ConvertingLogic.ConvertToString(Convert.ToInt32(inputField)));
            Console.ReadKey();
        }