aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/edu/brown/cs/student/SuspicionRankerTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/edu/brown/cs/student/SuspicionRankerTest.java')
-rw-r--r--src/test/java/edu/brown/cs/student/SuspicionRankerTest.java38
1 files changed, 34 insertions, 4 deletions
diff --git a/src/test/java/edu/brown/cs/student/SuspicionRankerTest.java b/src/test/java/edu/brown/cs/student/SuspicionRankerTest.java
index cb0fc6f..3f8ea3d 100644
--- a/src/test/java/edu/brown/cs/student/SuspicionRankerTest.java
+++ b/src/test/java/edu/brown/cs/student/SuspicionRankerTest.java
@@ -18,12 +18,18 @@ import static org.junit.Assert.assertTrue;
public class SuspicionRankerTest {
+ // ./cs32-test tests/student/hub/*.test
+
+ //friday april 9th
+ //private Instant start = Instant.ofEpochMilli(1618004180000L);
+
+ //saturday april 10th
+ //private Instant end = Instant.ofEpochMilli(1618019436000L);
+
//12 am on 3/11 in UTC
- //private Instant start = Instant.parse("2021-03-11T05:00:00.00Z");
- private Instant start = Instant.ofEpochMilli(161800418000L);
+ private Instant start = Instant.parse("2021-03-11T05:00:00.00Z");
//12 am on 3/28 in UTC
- //private Instant end = Instant.parse("2021-03-28T05:00:00.00Z");
- private Instant end = Instant.ofEpochMilli(1618019436000L);
+ private Instant end = Instant.parse("2021-03-28T05:00:00.00Z");
private DatabaseQuerier db;
@@ -53,5 +59,29 @@ public class SuspicionRankerTest {
tearDown();
}
+ @Test
+ public void testSusRankEmptyDB(){
+ try{
+ db = new DatabaseQuerier("data/testing/empty.sqlite3");
+ } catch(Exception e){
+ System.out.println("DBQuerier Test, couldn't connect to db???");
+ }
+ SuspicionRanker r = new SuspicionRanker(db);
+ List<Holder> vals = r.getSuspicionScoreList(start, end);
+ assertTrue(vals.isEmpty());
+ tearDown();
+
+ }
+
+ @Test
+ public void testBadDates(){
+ setUp();
+ SuspicionRanker r = new SuspicionRanker(db);
+ List<Holder> vals = r.getSuspicionScoreList(end, start);
+ assertTrue(vals.isEmpty());
+ tearDown();
+
+ }
+
}