public void fromRomanAssert() { Assert.AreEqual(Roman.fromRoman("I"), 1); Assert.AreEqual(Roman.fromRoman("II"), 2); Assert.AreEqual(Roman.fromRoman("III"), 3); Assert.AreEqual(Roman.fromRoman("IV"), 4); Assert.AreEqual(Roman.fromRoman("V"), 5); Assert.AreEqual(Roman.fromRoman("VI"), 6); Assert.AreEqual(Roman.fromRoman("VII"), 7); Assert.AreEqual(Roman.fromRoman("VIII"), 8); Assert.AreEqual(Roman.fromRoman("IX"), 9); Assert.AreEqual(Roman.fromRoman("X"), 10); Assert.AreEqual(Roman.fromRoman("L"), 50); Assert.AreEqual(Roman.fromRoman("C"), 100); Assert.AreEqual(Roman.fromRoman("D"), 500); Assert.AreEqual(Roman.fromRoman("M"), 1000); Assert.AreEqual(Roman.fromRoman("CXLVIII"), 148); Assert.AreEqual(Roman.fromRoman("DCCLXXXII"), 782); Assert.AreEqual(Roman.fromRoman("MDCCLIV"), 1754); Assert.AreEqual(Roman.fromRoman("MDCCCXXXII"), 1832); Assert.AreEqual(Roman.fromRoman("MMMDCCCXLIV"), 3844); Assert.AreEqual(Roman.fromRoman("MMMDCCCLXXXVIII"), 3888); Assert.AreEqual(Roman.fromRoman("MMMCMXCIX"), 3999); Assert.AreEqual(Roman.fromRoman("MMMMCMXCIX"), 4999); }
public void is_correct() { foreach (int number in Enumerable.Range(0, 3999)) { bool isReversable = Roman.fromRoman(Roman.toRoman(number)) == number; Assert.That( condition: isReversable, message: $"Couldn't successfully convert {number} back and forth" ); } }
public void negativeZeroCheck() { Assert.IsFalse(Roman.fromRoman("") < 0, "negative numbers are rejected"); }
public void fromRomanTests_160() { Assert.AreEqual(160, Roman.fromRoman("CLX")); }
public void fromRomanTests_100() { Assert.AreEqual(100, Roman.fromRoman("C")); }
public void fromRomanTests_88() { Assert.AreEqual(88, Roman.fromRoman("LXXXVIII")); }
public void fromRomanTests_50() { Assert.AreEqual(50, Roman.fromRoman("L")); }
public void fromRomanTests_29() { Assert.AreEqual(29, Roman.fromRoman("XXIX")); }
public void fromRomanTests_5() { Assert.AreEqual(5, Roman.fromRoman("V")); }
public void fromRomanTests_1() { Assert.AreEqual(1, Roman.fromRoman("I")); }
public void TestMethod1() { int res = Roman.fromRoman("I"); Assert.AreEqual(1, res); }
public void fromRomanTest() { int res = Roman.fromRoman("L"); Assert.AreEqual(50, res); }
public void typeCheck() { Assert.IsInstanceOfType(Roman.fromRoman("I"), typeof(int), "Bad instance of return, should be Integer"); }
public void emptyCheck() { Assert.IsNotNull(Roman.fromRoman("I"), "returned empty value"); }
public void fromRomanTests_4() { Assert.AreEqual(4, Roman.fromRoman("IV")); }
public void addRomanTests_n3999_nr1() { Assert.AreEqual("IV", Roman.addRoman(Roman.toRoman(3999), Roman.toRoman(Roman.fromRoman("I")))); }
public void fromRomanTests_999() { Assert.AreEqual(999, Roman.fromRoman("CMXCIX")); }
public void fromRomanTests_9() { Assert.AreEqual(9, Roman.fromRoman("IX")); }
public void fromRomanTests_1500() { Assert.AreEqual(1500, Roman.fromRoman("MD")); }
public void fromRomanTests_49() { Assert.AreEqual(49, Roman.fromRoman("XLIX")); }
public void fromRomanTests_1800() { Assert.AreEqual(1800, Roman.fromRoman("MDCCC")); }
public void fromRomanTests_83() { Assert.AreEqual(83, Roman.fromRoman("LXXXIII")); }
public void fromRomanTests_2500() { Assert.AreEqual(2500, Roman.fromRoman("MMC")); }
public void fromRomanTests_90() { Assert.AreEqual(90, Roman.fromRoman("XC")); }
public void fromRomanTests_3000() { Assert.AreEqual(3000, Roman.fromRoman("MMM")); }
public void fromRomanTests_110() { Assert.AreEqual(110, Roman.fromRoman("CX")); }
public void fromRomanTests_3999() { Assert.AreEqual(3999, Roman.fromRoman("MMMCMXCIX")); }
public void fromRomanTests_3() { Assert.AreEqual(3, Roman.fromRoman("III")); }
public void upperBoundCheck() { Assert.IsFalse(Roman.fromRoman("") > 4999, "number is too big"); }