private bool IsValidRomanNumberFormation(List <string> constants)
        {
            var romanNumbers = constants
                               .Select(p => _executionContext.ConstantsToRomanMap[p])
                               .ToArray();

            return(RomanNumbersUtility.IsValid(string.Join("", romanNumbers)));
        }
        public void ThreeDigitRomanNumeralAdditionTest()
        {
            var result = RomanNumbersUtility.ConvertRomantoNumber(new RomanNumber[] { RomanNumber.V, RomanNumber.I, RomanNumber.I });

            Assert.AreEqual(7, result);
        }
        public void TwoDigitRomanNumeralSubtractionTest()
        {
            var result = RomanNumbersUtility.ConvertRomantoNumber(new RomanNumber[] { RomanNumber.C, RomanNumber.D });

            Assert.AreEqual(400, result);
        }
Exemplo n.º 4
0
 private decimal CalculateUnitValue(RomanNumber[] romanNumbers, decimal value)
 {
     return(RomanNumbersUtility.ConvertRomantoNumber(romanNumbers) * value);
 }