From 1472224b557fc3351e1f980df7126ec1f01ccb00 Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Sun, 27 Nov 2016 17:56:00 +0100 Subject: [PATCH] Writing test for XVIII We see duplications again :) --- .../main/java/org/craftedsw/romannumerals/RomanNumeralGenerator.java | 2 +- .../java/org/craftedsw/romannumerals/RomanNumeralsGeneratorShould.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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 72ea173..c9ebc6a 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 @@ -4,7 +4,7 @@ public class RomanNumeralGenerator { public static String romanFor(int decimal) { String roman = ""; - if (decimal == 10) { + if (decimal >= 10) { roman += "X"; decimal -= 10; } 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 41d250b..4c3eafc 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,7 @@ public class RomanNumeralsGeneratorShould { assertThat(romanFor(5), is("V")); assertThat(romanFor(7), is("VII")); assertThat(romanFor(10), is("X")); + assertThat(romanFor(18), is("XVIII")); } } -- 2.1.4