Behavioral.Iterator.IteratorTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 15
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testAggregatesItems() 0 6 1
A setUp() 0 3 1
1
/*
2
 * @author  : Jagepard <[email protected]>
3
 * @license https://mit-license.org/ MIT
4
 */
5
6
package Behavioral.Iterator;
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 IteratorTest {
14
15
    private ClientInterface client;
16
17
    @BeforeEach
18
    void setUp() {
19
        this.client = new Client();
20
    }
21
22
    @Test
23
    void testAggregatesItems() {
24
        this.client.addItemToTheBucket(new Item("Tights", 150, "darned"));
25
        IteratorInterface employee = new Iterator(this.client.getBucket());
26
27
        assertEquals("Tights 150 darned\n", employee.iterateItems());
28
    }
29
}