From b2cf3450bbd54efeedb6c1c1c2f7e5909275d28a Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Sun, 27 Nov 2016 18:36:51 +0100 Subject: [PATCH] We will add our exceptions to the enum. --- .../java/org/craftedsw/romannumerals/RomanNumeralGenerator.java | 9 +++++++++ .../craftedsw/romannumerals/RomanNumeralsGeneratorShould.java | 2 ++ 2 files changed, 11 insertions(+) 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")); } } -- 2.1.4