Behavioral.Interpreter.InterpreterTest.testAlbum()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 6
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
1
/*
2
 * @author  : Jagepard <[email protected]>
3
 * @license https://mit-license.org/ MIT
4
 */
5
6
package Behavioral.Interpreter;
7
8
import org.junit.jupiter.api.BeforeEach;
9
import org.junit.jupiter.api.Test;
10
11
import static org.junit.jupiter.api.Assertions.*;
12
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
}