From 4585634120e3300d32aef14a6e32ded6f1b26c55 Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Sun, 27 Nov 2016 17:30:33 +0100 Subject: [PATCH] Again we write the simplest thing to make our test green And we see duplications :) --- .../main/java/org/craftedsw/romannumerals/RomanNumeralGenerator.java | 3 +++ .../java/org/craftedsw/romannumerals/RomanNumeralsGeneratorShould.java | 1 + 2 files changed, 4 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 8ead555..3409176 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 @@ -3,6 +3,9 @@ package org.craftedsw.romannumerals; public class RomanNumeralGenerator { public static String romanFor(int decimal) { + if (decimal == 3) { + return "III"; + } if (decimal == 2) { return "II"; } 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 cff8122..4d18c40 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 @@ -17,6 +17,7 @@ public class RomanNumeralsGeneratorShould { // Method's name must describe what the assert is doing!!! assertThat(romanFor(1), is("I")); assertThat(romanFor(2), is("II")); + assertThat(romanFor(3), is("III")); } } -- 2.1.4