From: Gustavo Martin Morcuende Date: Sun, 27 Nov 2016 17:36:51 +0000 (+0100) Subject: We will add our exceptions to the enum. X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=b2cf3450bbd54efeedb6c1c1c2f7e5909275d28a;p=JavaForFun We will add our exceptions to the enum. --- diff --git a/TDD/sandromancuso/romannumerals/src/main/java/org/craftedsw/romannumerals/RomanNumeralGenerator.java b/TDD/sandromancuso/romannumerals/src/main/java/org/craftedsw/romannumerals/RomanNumeralGenerator.java index 3460afe..954a988 100644 --- a/TDD/sandromancuso/romannumerals/src/main/java/org/craftedsw/romannumerals/RomanNumeralGenerator.java +++ b/TDD/sandromancuso/romannumerals/src/main/java/org/craftedsw/romannumerals/RomanNumeralGenerator.java @@ -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); diff --git a/TDD/sandromancuso/romannumerals/src/test/java/org/craftedsw/romannumerals/RomanNumeralsGeneratorShould.java b/TDD/sandromancuso/romannumerals/src/test/java/org/craftedsw/romannumerals/RomanNumeralsGeneratorShould.java index 84139b6..46483ba 100644 --- a/TDD/sandromancuso/romannumerals/src/test/java/org/craftedsw/romannumerals/RomanNumeralsGeneratorShould.java +++ b/TDD/sandromancuso/romannumerals/src/test/java/org/craftedsw/romannumerals/RomanNumeralsGeneratorShould.java @@ -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")); } }