public void ToArabicTest_SpecialNumbers()
 {
     foreach (var number in specialNumbers)
     {
         Assert.AreEqual(number.Value, RomanConvertor.ToArabic(number.Key));
     }
 }
 public void ToArabicTest_RandomSuccessfulValues()
 {
     foreach (var number in sampleRandomNumbers)
     {
         Assert.AreEqual(number.Value, RomanConvertor.ToArabic(number.Key));
     }
 }
 public void ToRomanTest_TestNegative()
 {
     Assert.ThrowsException <InvalidOperationException>(() =>
     {
         var result = RomanConvertor.ToRoman(-1);
     }
                                                        );
 }
        public void Test_Sanity()
        {
            var originalRomanNumber = "MCDXCVIII";
            var convertedArabic     = RomanConvertor.ToArabic(originalRomanNumber);
            var convertedRoman      = RomanConvertor.ToRoman(convertedArabic);

            Assert.AreEqual(originalRomanNumber, convertedRoman);
        }
 public void ToArabicTest_InvalidChars()
 {
     Assert.ThrowsException <FormatException>(() =>
     {
         var result = RomanConvertor.ToArabic("XXBBIIOO");
     }
                                              );
 }
 public void ToRomanTest_TestMoreThan4000()
 {
     Assert.ThrowsException <InvalidOperationException>(() =>
     {
         var result = RomanConvertor.ToRoman(4001);
     }
                                                        );
 }
Beispiel #7
0
 public void ConvertToRoman(int arabicValue, string romanValue)
 {
     Assert.AreEqual(romanValue, RomanConvertor.ToRoman(arabicValue));
 }
 public void ToRomanTest_RepeatingSingleDigits()
 {
     Assert.AreEqual("I", RomanConvertor.ToRoman(1));
     Assert.AreEqual("III", RomanConvertor.ToRoman(3));
 }