-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
~ testing: use on demand static imports
Where it was not done yet.
- Loading branch information
Showing
2 changed files
with
25 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 21 additions & 20 deletions
41
...test/java/ch/scs/jumpstart/romannumerals/solution/SolutionRomanNumeralsConverterTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,35 @@ | ||
package ch.scs.jumpstart.romannumerals.solution; | ||
|
||
import static ch.scs.jumpstart.romannumerals.solution.SolutionRomanNumeralsConverter.*; | ||
import static org.hamcrest.MatcherAssert.assertThat; | ||
import static org.hamcrest.Matchers.is; | ||
import static org.hamcrest.Matchers.nullValue; | ||
|
||
import org.hamcrest.MatcherAssert; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class SolutionRomanNumeralsConverterTest { | ||
|
||
@Test | ||
public void return_roman_number_for_arabic_number() { | ||
MatcherAssert.assertThat(SolutionRomanNumeralsConverter.convert(0), nullValue()); | ||
MatcherAssert.assertThat(SolutionRomanNumeralsConverter.convert(1), is("I")); | ||
MatcherAssert.assertThat(SolutionRomanNumeralsConverter.convert(2), is("II")); | ||
MatcherAssert.assertThat(SolutionRomanNumeralsConverter.convert(3), is("III")); | ||
MatcherAssert.assertThat(SolutionRomanNumeralsConverter.convert(5), is("V")); | ||
MatcherAssert.assertThat(SolutionRomanNumeralsConverter.convert(10), is("X")); | ||
MatcherAssert.assertThat(SolutionRomanNumeralsConverter.convert(50), is("L")); | ||
MatcherAssert.assertThat(SolutionRomanNumeralsConverter.convert(100), is("C")); | ||
MatcherAssert.assertThat(SolutionRomanNumeralsConverter.convert(500), is("D")); | ||
MatcherAssert.assertThat(SolutionRomanNumeralsConverter.convert(1000), is("M")); | ||
MatcherAssert.assertThat(SolutionRomanNumeralsConverter.convert(2687), is("MMDCLXXXVII")); | ||
assertThat(convert(0), nullValue()); | ||
assertThat(convert(1), is("I")); | ||
assertThat(convert(2), is("II")); | ||
assertThat(convert(3), is("III")); | ||
assertThat(convert(5), is("V")); | ||
assertThat(convert(10), is("X")); | ||
assertThat(convert(50), is("L")); | ||
assertThat(convert(100), is("C")); | ||
assertThat(convert(500), is("D")); | ||
assertThat(convert(1000), is("M")); | ||
assertThat(convert(2687), is("MMDCLXXXVII")); | ||
|
||
MatcherAssert.assertThat(SolutionRomanNumeralsConverter.convert(4), is("IV")); | ||
MatcherAssert.assertThat(SolutionRomanNumeralsConverter.convert(9), is("IX")); | ||
MatcherAssert.assertThat(SolutionRomanNumeralsConverter.convert(40), is("XL")); | ||
MatcherAssert.assertThat(SolutionRomanNumeralsConverter.convert(90), is("XC")); | ||
MatcherAssert.assertThat(SolutionRomanNumeralsConverter.convert(400), is("CD")); | ||
MatcherAssert.assertThat(SolutionRomanNumeralsConverter.convert(900), is("CM")); | ||
MatcherAssert.assertThat(SolutionRomanNumeralsConverter.convert(949), is("CMXLIX")); | ||
MatcherAssert.assertThat(SolutionRomanNumeralsConverter.convert(3999), is("MMMCMXCIX")); | ||
assertThat(convert(4), is("IV")); | ||
assertThat(convert(9), is("IX")); | ||
assertThat(convert(40), is("XL")); | ||
assertThat(convert(90), is("XC")); | ||
assertThat(convert(400), is("CD")); | ||
assertThat(convert(900), is("CM")); | ||
assertThat(convert(949), is("CMXLIX")); | ||
assertThat(convert(3999), is("MMMCMXCIX")); | ||
} | ||
} |