public void RomanNumeral_Parse_InvalidClassicNotation() { //substractive notation Assert.IsNull(RomanNumeral.Parse("IV")); Assert.IsNull(RomanNumeral.Parse("IX")); //invalid order Assert.IsNull(RomanNumeral.Parse("IVL")); //valid order Assert.IsNotNull(RomanNumeral.Parse("LVI")); }
public void RomanNumeral_Assign_Int() { RomanNumeral x = 4; Assert.AreEqual(4, x.Number); }
public void RomanNumeral_Add_Int() { var x = new RomanNumeral(0) + 4; Assert.AreEqual(4, x.Number); }
public void RomanNumeral_Add_StringAndInt() { var x = new RomanNumeral(0) + "IV" + 4; Assert.AreEqual(8, x.Number); }
public void RomanNumeral_Assign_String() { RomanNumeral x = "IV"; Assert.AreEqual(4, x.Number); }
public void RomanNumeral_Add_IntAndString() { var x = new RomanNumeral(0) + 4 + "IV"; Assert.AreEqual(8, x.Number); }
public void RomanNumeral_Add_String() { var x = new RomanNumeral(0) + "IV"; Assert.AreEqual(4, x.Number); }
public static string operator -(string r1, RomanNumeral r2) { var r = RomanNumeral.Parse(r1) + r2; return(r.ToString()); }
public static int operator -(int r1, RomanNumeral r2) { var r = new RomanNumeral(r1) - r2; return(r.Number); }
public static RomanNumeral operator +(RomanNumeral r1, string r2) { return(r1 + RomanNumeral.Parse(r2)); }