blob: c8f2bd3d8f413e64b9981d530da2168fd1747d59 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
package io.github.bculkin2442.esodata;
import org.junit.Test;
import bjc.esodata.ThresholdSet;
import io.github.bculkin2442.TestUtils;
import java.util.Iterator;
import static org.junit.Assert.*;
import static io.github.bculkin2442.TestUtils.*;
/**
* Tests for ThresholdSet
*
* @author Ben Culkin.
*/
public class ThresholdSetTest {
@Test
public void testAdd() {
ThresholdSet<String> thst = new ThresholdSet<>();
thst.addAll("a", "b");
assertIteratorEquals(false, thst.setView().iterator(), "a", "b");
}
@Test
public void testAddMulti() {
ThresholdSet<String> thst = new ThresholdSet<>();
thst.addAll("a", "b", "a");
assertIteratorEquals(false, thst.setView().iterator(), "b");
}
@Test
public void testRemoveMulti() {
ThresholdSet<String> thst = new ThresholdSet<>();
thst.addAll("a", "a", "b");
thst.removeAll("a");
assertIteratorEquals(false, thst.setView().iterator(), "a", "b");
}
}
|