Sha256: fa18c2834d034d1d8e1e04f1496119636278d7a1b071ffb12df07ae7e8885531

Contents?: true

Size: 1.4 KB

Versions: 48

Compression:

Stored size: 1.4 KB

Contents

import org.junit.Test;
import org.junit.Ignore;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;

import java.util.Arrays;
import java.util.Collection;

import static org.junit.Assert.assertEquals;

@RunWith(Parameterized.class)
public class RomanNumeralsTest {

    private int input;
    private String expectedOutput;

    @Parameters
    public static Collection<Object[]> data() {
        return Arrays.asList(new Object[][]{
                {0, ""},
                {1, "I"},
                {2, "II"},
                {3, "III"},
                {4, "IV"},
                {5, "V"},
                {6, "VI"},
                {9, "IX"},
                {27, "XXVII"},
                {48, "XLVIII"},
                {59, "LIX"},
                {93, "XCIII"},
                {141, "CXLI"},
                {163, "CLXIII"},
                {402, "CDII"},
                {575, "DLXXV"},
                {911, "CMXI"},
                {1024, "MXXIV"},
                {3000, "MMM"}
        });
    }

    public RomanNumeralsTest(int input, String expectedOutput) {
        this.input = input;
        this.expectedOutput = expectedOutput;
    }


    @Test
    public void convertArabicNumberalToRomanNumeral() {
        RomanNumeral romanNumeral = new RomanNumeral(input);

        assertEquals(expectedOutput, romanNumeral.getRomanNumeral());
    }
}

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
trackler-2.0.5.11 tracks/java/exercises/roman-numerals/src/test/java/RomanNumeralsTest.java
trackler-2.0.5.10 tracks/java/exercises/roman-numerals/src/test/java/RomanNumeralsTest.java
trackler-2.0.5.9 tracks/java/exercises/roman-numerals/src/test/java/RomanNumeralsTest.java
trackler-2.0.5.8 tracks/java/exercises/roman-numerals/src/test/java/RomanNumeralsTest.java
trackler-2.0.5.7 tracks/java/exercises/roman-numerals/src/test/java/RomanNumeralsTest.java
trackler-2.0.5.6 tracks/java/exercises/roman-numerals/src/test/java/RomanNumeralsTest.java
trackler-2.0.5.5 tracks/java/exercises/roman-numerals/src/test/java/RomanNumeralsTest.java
trackler-2.0.5.4 tracks/java/exercises/roman-numerals/src/test/java/RomanNumeralsTest.java
trackler-2.0.5.3 tracks/java/exercises/roman-numerals/src/test/java/RomanNumeralsTest.java
trackler-2.0.5.2 tracks/java/exercises/roman-numerals/src/test/java/RomanNumeralsTest.java
trackler-2.0.5.1 tracks/java/exercises/roman-numerals/src/test/java/RomanNumeralsTest.java
trackler-2.0.5.0 tracks/java/exercises/roman-numerals/src/test/java/RomanNumeralsTest.java
trackler-2.0.4.0 tracks/java/exercises/roman-numerals/src/test/java/RomanNumeralsTest.java
trackler-2.0.3.9 tracks/java/exercises/roman-numerals/src/test/java/RomanNumeralsTest.java
trackler-2.0.3.8 tracks/java/exercises/roman-numerals/src/test/java/RomanNumeralsTest.java
trackler-2.0.3.7 tracks/java/exercises/roman-numerals/src/test/java/RomanNumeralsTest.java
trackler-2.0.3.6 tracks/java/exercises/roman-numerals/src/test/java/RomanNumeralsTest.java
trackler-2.0.3.5 tracks/java/exercises/roman-numerals/src/test/java/RomanNumeralsTest.java
trackler-2.0.3.4 tracks/java/exercises/roman-numerals/src/test/java/RomanNumeralsTest.java
trackler-2.0.3.3 tracks/java/exercises/roman-numerals/src/test/java/RomanNumeralsTest.java