We will add our exceptions to the enum.
authorGustavo Martin Morcuende <gu.martinm@gmail.com>
Sun, 27 Nov 2016 17:36:51 +0000 (18:36 +0100)
committerGustavo Martin Morcuende <gu.martinm@gmail.com>
Sun, 27 Nov 2016 17:36:51 +0000 (18:36 +0100)
TDD/sandromancuso/romannumerals/src/main/java/org/craftedsw/romannumerals/RomanNumeralGenerator.java
TDD/sandromancuso/romannumerals/src/test/java/org/craftedsw/romannumerals/RomanNumeralsGeneratorShould.java

index 3460afe..954a988 100644 (file)
@@ -15,7 +15,16 @@ public class RomanNumeralGenerator {
        }
 
        enum RomanToDecimal {
+               THOUSAND("M", 1000),
+               NINE_HUNDRED("CM", 900),
+               FIVE_HUNDRED("D", 500),
+               FOUR_HUNDRED("CD", 400),
+               HUNDRED("C", 100),
+               NINETY("XC", 90),
+               FIFTY("L", 50),
+               FOURTY("XL", 40),
                TEN("X", 10),
+               NINE("IX", 9),
                FIVE("V", 5),
                FOUR("IV", 4),
                ONE("I", 1);
index 84139b6..46483ba 100644 (file)
@@ -24,6 +24,8 @@ public class RomanNumeralsGeneratorShould {
                assertThat(romanFor(10), is("X"));
                assertThat(romanFor(18), is("XVIII"));
                assertThat(romanFor(30), is("XXX"));
+               assertThat(romanFor(2687), is("MMDCLXXXVII"));
+               assertThat(romanFor(3499), is("MMMCDXCIX"));
        }
 
 }