Exemple #1
0
        public void Return4ForIV()
        {
            string        numberRoman = "IV";
            StringBuilder sb          = new StringBuilder();

            sb.Append(numberRoman);
            int?expectedResult = 4;
            int?returnedValue;

            GoForIt gfi1 = new GoForIt();

            returnedValue = gfi1.CalculateArabicNumber(numberRoman);

            Assert.AreEqual(expectedResult, returnedValue);
        }
Exemple #2
0
        public void ReturnNullIfTwoIIsInFrontOfBiggerNumber()
        {
            string        numberRoman = "IIC";
            StringBuilder sb          = new StringBuilder();

            sb.Append(numberRoman);
            int?expectedResult = null;
            int?returnedValue;

            GoForIt gfi1 = new GoForIt();

            returnedValue = gfi1.CalculateArabicNumber(numberRoman);

            Assert.AreEqual(expectedResult, returnedValue);
        }
Exemple #3
0
        public void ReturnNullIfAnythingBiggerThanLFollowsIt()
        {
            string        numberRoman = "LCDM";
            StringBuilder sb          = new StringBuilder();

            sb.Append(numberRoman);
            int?expectedResult = null;
            int?returnedValue;

            GoForIt gfi1 = new GoForIt();

            returnedValue = gfi1.CalculateArabicNumber(numberRoman);

            Assert.AreEqual(expectedResult, returnedValue);
        }
Exemple #4
0
        public void ReturnNullForMoreThan1Non_ConsecutiveV()
        {
            string        numberRoman = "VIV";
            StringBuilder sb          = new StringBuilder();

            sb.Append(numberRoman);
            int?expectedResult = 9;
            int?returnedValue;

            GoForIt gfi1 = new GoForIt();

            returnedValue = gfi1.CalculateArabicNumber(numberRoman);

            Assert.AreEqual(expectedResult, returnedValue);
        }