Total Complexity | 3 |
Total Lines | 24 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | /* |
||
13 | class InterpreterTest { |
||
14 | private InterpreterInterface interpreter; |
||
15 | |||
16 | @BeforeEach |
||
17 | void setUp() { |
||
18 | this.interpreter = new Interpreter(); |
||
19 | ((Interpreter) this.interpreter).addAlbumToRegistry(new Album("Korn", "Untouchables")); |
||
20 | ((Interpreter) this.interpreter).addAlbumToRegistry(new Album("Deftones", "Adrenaline")); |
||
21 | } |
||
22 | |||
23 | @Test |
||
24 | void testAlbum() { |
||
25 | assertEquals(this.interpreter.interpret("album 1"), "Untouchables "); |
||
26 | assertEquals(this.interpreter.interpret("1 album"), "Untouchables "); |
||
27 | assertEquals(this.interpreter.interpret("album 2"), "Adrenaline "); |
||
28 | assertEquals(this.interpreter.interpret("2 album"), "Adrenaline "); |
||
29 | } |
||
30 | |||
31 | @Test |
||
32 | void testAuthor() { |
||
33 | assertEquals(this.interpreter.interpret("author 1"), "Korn "); |
||
34 | assertEquals(this.interpreter.interpret("1 author"), "Korn "); |
||
35 | assertEquals(this.interpreter.interpret("author 2"), "Deftones "); |
||
36 | assertEquals(this.interpreter.interpret("2 author"), "Deftones "); |
||
37 | } |
||
38 | } |