public void ConvertFromRomanNumeralToInt_SendRomanNumeralsWithBadSymbolsPosition_Throws(string invalidRomanNumeral) { RomanNumeralsConverter conv = new RomanNumeralsConverter(); var ex = Assert.Throws <ArgumentException>(() => conv.ConvertFromRomanNumeralToInt(invalidRomanNumeral)); StringAssert.Contains("bad format of symbols positions", ex.Message); }
public void ConvertFromRomanNumeralToInt_SendRomanNumeralsWithTooManyTheSameSymbols_Throws(string invalidRomanNumeral) { RomanNumeralsConverter conv = new RomanNumeralsConverter(); var ex = Assert.Throws <ArgumentException>(() => conv.ConvertFromRomanNumeralToInt(invalidRomanNumeral)); StringAssert.Contains("too many of the same symbols in row", ex.Message); }
public void ConvertFromRomanNumeralToInt_InvalidRomanNumeral_Throws() { RomanNumeralsConverter conv = new RomanNumeralsConverter(); var ex = Assert.Throws <ArgumentException>(() => conv.ConvertFromRomanNumeralToInt("Invalid roman numeral")); StringAssert.Contains("invalid symbols", ex.Message); }
public void ConvertFromRomanNumeralToInt_SendEmptyString_Throwsn() { RomanNumeralsConverter conv = new RomanNumeralsConverter(); var ex = Assert.Throws <ArgumentException>(() => conv.ConvertFromRomanNumeralToInt("")); StringAssert.Contains("is empty", ex.Message); }
public void ConvertFromRomanNumeralToInt_ValidRomanNumerals_ReturnsInt(string romanNumeral, int expected) { RomanNumeralsConverter conv = new RomanNumeralsConverter(); int result = conv.ConvertFromRomanNumeralToInt(romanNumeral); Assert.AreEqual(expected, result); }