public void RomanTest(int input, string expected)
        {
            _subject = new RomanNumerals();

            var result = _subject.Convert(input);

            Assert.Equal(expected, result);
        }
        public void ReturnRomanGivenArabic(int input, string expected)
        {
            var numero = new RomanNumerals();

            var result = numero.Convert(input);

            Assert.AreEqual(expected, result);
        }
示例#3
0
        public void Given_Input_Should_Return_Roman(int input, string expected)
        {
            var sut = new RomanNumerals();

            var result = sut.Convert(input);

            Assert.Equal(expected, result);
        }
示例#4
0
        public void Convert_GivenANumberMoreThan49ButLessThan90_ShouldReturnItsRomanNumeral(string expected, int number)
        {
            //---------------Arrange-------------------
            var sut = new RomanNumerals();
            //---------------Act ----------------------
            var actual = sut.Convert(number);

            //---------------Assert -----------------------
            Assert.AreEqual(expected, actual);
        }
示例#5
0
        public static void Main(string[] args)
        {
            var roman = new RomanNumerals();

            System.Console.WriteLine("Give me a number:");
            var input = System.Console.ReadLine();

            try {
                var output = roman.Convert(int.Parse(input));
                System.Console.WriteLine("The roman numeral is:");
                System.Console.WriteLine(output);
            } catch {
                System.Console.WriteLine("Whoops!");
            }
        }
 public void ConverterReturnsString()
 {
     Assert.IsInstanceOf <string>(_romanNumerals.Convert(5));
 }
        public void ToArab()
        {
            var res = RomanNumerals.Convert("MCMX");

            Assert.Equal(1910, res);
        }
        public void ToRoman()
        {
            var res = RomanNumerals.Convert(1910);

            Assert.Equal("MCMX", res);
        }
示例#9
0
 public void ConvertArabicNumeralsToRoman(int arabicNumber, string rommanNumber)
 {
     Assert.Equal(rommanNumber, romanNumerals.Convert(arabicNumber));
 }
示例#10
0
 public void Test1()
 {
     Assert.AreEqual(1941, RomanNumerals.Evaluate("MCMXLI"));
     Assert.AreEqual("MCMXLI", RomanNumerals.Convert(1941));
 }
示例#11
0
 public void Test4()
 {
     Assert.AreEqual(2882, RomanNumerals.Evaluate("MMDCCCLXXXII"));
     Assert.AreEqual("MMDCCCLXXXII", RomanNumerals.Convert(2882));
 }
示例#12
0
 public void Test3()
 {
     Assert.AreEqual(1398, RomanNumerals.Evaluate("MCCCXCVIII"));
     Assert.AreEqual("MCCCXCVIII", RomanNumerals.Convert(1398));
 }
示例#13
0
 public void Test2()
 {
     Assert.AreEqual(1159, RomanNumerals.Evaluate("MCLIX"));
     Assert.AreEqual("MCLIX", RomanNumerals.Convert(1159));
 }