summaryrefslogtreecommitdiff
path: root/src/test/java/bjc/esodata
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/bjc/esodata')
-rw-r--r--src/test/java/bjc/esodata/ThresholdSetTest.java46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/test/java/bjc/esodata/ThresholdSetTest.java b/src/test/java/bjc/esodata/ThresholdSetTest.java
new file mode 100644
index 0000000..b37f866
--- /dev/null
+++ b/src/test/java/bjc/esodata/ThresholdSetTest.java
@@ -0,0 +1,46 @@
+package bjc.esodata;
+
+import org.junit.Test;
+
+import bjc.TestUtils;
+import bjc.esodata.ThresholdSet;
+
+import java.util.Iterator;
+
+import static bjc.TestUtils.*;
+import static org.junit.Assert.*;
+
+/**
+ * Tests for ThresholdSet
+ *
+ * @author Ben Culkin.
+ */
+public class ThresholdSetTest {
+ @Test
+ public void testAdd() {
+ ThresholdSet<String> thst = new ThresholdSet<>();
+
+ thst.addKeys("a", "b");
+
+ assertIteratorEquals(false, thst.setView().iterator(), "a", "b");
+ }
+
+ @Test
+ public void testAddMulti() {
+ ThresholdSet<String> thst = new ThresholdSet<>();
+
+ thst.addKeys("a", "b", "a");
+
+ assertIteratorEquals(false, thst.setView().iterator(), "b");
+ }
+
+ @Test
+ public void testRemoveMulti() {
+ ThresholdSet<String> thst = new ThresholdSet<>();
+
+ thst.addKeys("a", "a", "b");
+ thst.removeKeys("a");
+
+ assertIteratorEquals(false, thst.setView().iterator(), "a", "b");
+ }
+}