public ConvertRomanNumberToArabic ( string romanFormatNumber ) : int | ||
romanFormatNumber | string | |
return | int |
public void RomanCalculatorUnitTest_CorrectnessConvertingRomanNumbersToArabic() { if (!IsInitializedDictionary) InitializeDictionary(); var parser = new ParserArithmeticExpression(); foreach (var arabicNumber in dictionaryOfArabicAndRomanNumbers.Keys) { var romanNumber = dictionaryOfArabicAndRomanNumbers[arabicNumber]; var expectedArabicNumber = arabicNumber; var actualArabicNumberAfterConverting = parser.ConvertRomanNumberToArabic(romanNumber); Assert.AreEqual(expectedArabicNumber, actualArabicNumberAfterConverting); } }
public void ConvertRomanNumberToArabic_CorrectValue() { if (!IsInitializedDictionary) InitializeDictionary(); var parser = new ParserArithmeticExpression(); foreach (var romanNumber in dictionaryOfArabicAndRomanNumbers.Values) { var arabicNumber = dictionaryOfArabicAndRomanNumbers.FirstOrDefault(x => x.Value == romanNumber).Key; ; var expectedArabicNumber = arabicNumber; var actualArabicNumberAfterConverting = parser.ConvertRomanNumberToArabic(romanNumber); Assert.AreEqual(expectedArabicNumber, actualArabicNumberAfterConverting); } }