public void TestRoman_CanRepeat() { Assert.AreEqual(2, Roman.Parse("II")); Assert.AreEqual(300, Roman.Parse("CCC")); Assert.AreEqual(39, Roman.Parse("XXXIX")); Assert.AreEqual(2000, Roman.Parse("MM")); }
public void TestRoman_NotDefined() { const string line = "pish tegj glob glob"; Dictionary <string, RomanPrimitive> romanMapping = new Dictionary <string, RomanPrimitive> { { "pish", RomanPrimitive.Parse('X') }, { "tegj", RomanPrimitive.Parse('L') } }; Roman.Parse(line, romanMapping); }
public void TestRoman() { const string line = "pish tegj glob glob"; Dictionary <string, RomanPrimitive> romanMapping = new Dictionary <string, RomanPrimitive> { { "glob", RomanPrimitive.Parse('I') }, { "pish", RomanPrimitive.Parse('X') }, { "tegj", RomanPrimitive.Parse('L') } }; Assert.AreEqual(42, Roman.Parse(line, romanMapping)); }
public void Parse(int expected, string roman) { Assert.AreEqual(expected, Roman.Parse(roman)); }
public void TestRoman_CannotSubtract() { Roman.Parse("VX"); }
public void TestRoman_CanSubtract() { Assert.AreEqual(444, Roman.Parse("CDXLIV")); Assert.AreEqual(999, Roman.Parse("CMXCIX")); }
public void TestRoman_CannotRepeat() { Roman.Parse("VV"); }
public void TestRoman_ExceedMaxRepeatCount() { Roman.Parse("IIII"); }
public void TestRoman_OnePrimitive() { Assert.AreEqual(10, Roman.Parse("X")); }
public void TestRoman_InvalidSubtractFrom() { Roman.Parse("IL"); }