public void ToRomanTest_SpecialNumbers()
 {
     foreach (var number in specialNumbers)
     {
         Assert.AreEqual(number.Key, RomanConvertor.ToRoman(number.Value));
     }
 }
 public void ToRomanTest_RandomSuccessfulValues()
 {
     foreach (var number in sampleRandomNumbers)
     {
         Assert.AreEqual(number.Key, RomanConvertor.ToRoman(number.Value));
     }
 }
 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 ToRomanTest_TestMoreThan4000()
 {
     Assert.ThrowsException <InvalidOperationException>(() =>
     {
         var result = RomanConvertor.ToRoman(4001);
     }
                                                        );
 }
Пример #6
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));
 }