From 4d0a59a0023f2b4fca144a089a3f75acb4ebd62b Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Tue, 2 Jul 2019 18:32:37 -0400 Subject: Move tests to new package --- src/test/java/bjc/esodata/ThresholdSetTest.java | 46 +++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/test/java/bjc/esodata/ThresholdSetTest.java (limited to 'src/test/java/bjc/esodata') 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 thst = new ThresholdSet<>(); + + thst.addKeys("a", "b"); + + assertIteratorEquals(false, thst.setView().iterator(), "a", "b"); + } + + @Test + public void testAddMulti() { + ThresholdSet thst = new ThresholdSet<>(); + + thst.addKeys("a", "b", "a"); + + assertIteratorEquals(false, thst.setView().iterator(), "b"); + } + + @Test + public void testRemoveMulti() { + ThresholdSet thst = new ThresholdSet<>(); + + thst.addKeys("a", "a", "b"); + thst.removeKeys("a"); + + assertIteratorEquals(false, thst.setView().iterator(), "a", "b"); + } +} -- cgit v1.2.3