Exemplo n.º 1
0
        public static string Solve(string rnExpression)
        {
            string normalExpression = RomanExpression.ChangeRomanExpressionToNormalExpression(rnExpression);
            string rpn           = RPN.ConvertToRPN(normalExpression);
            int    decimalResult = RPN.SolveRPN(rpn);
            string romanResult   = new RomanNumeral(decimalResult).romanNumeralStr;

            return(romanResult);
        }
Exemplo n.º 2
0
        public void AddWhitespacesBetweenOperators_ValidExpression_ReturnExpressionWithWhitespaces(string expression, string expected)
        {
            string result = RomanExpression.AddWhitespacesBetweenOperators(expression);

            Assert.AreEqual(expected, result);
        }
Exemplo n.º 3
0
        public void ChangeRomanExpressionToNormalExpression_ValidExpression_ReturnNormalExpression(string expression, string expected)
        {
            string result = RomanExpression.ChangeRomanExpressionToNormalExpression(expression);

            Assert.AreEqual(expected, result);
        }