-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRomanNumeralTest.java
More file actions
24 lines (20 loc) · 871 Bytes
/
RomanNumeralTest.java
File metadata and controls
24 lines (20 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//This class test the RomanNumeral class and its methods.
public class RomanNumeralTest {
@Test
public void testRomanToIntBasic() {
RomanNumeral romanConverter = new RomanNumeral();
int result = romanConverter.romanToInt("VII");
assertEquals(7, result, "Conversion of 'VII' should be 7");
}
//method to check if the test result matches the expected output.
private void assertEquals(int i, int result, String string) {
throw new UnsupportedOperationException("Unimplemented method 'assertEquals'");
}
//test method to check the conversion of a more complex Roman numeral.
@Test
public void testRomanToIntComplex() {
RomanNumeral romanConverter = new RomanNumeral();
int result = romanConverter.romanToInt("XIV");
assertEquals(14, result, "Conversion of 'XIV' should be 14");
}
}