From 7cf6c2b08add62df693a9a2e2c1ee0ed6f0c5aee Mon Sep 17 00:00:00 2001 From: Julia McCauley Date: Fri, 16 Apr 2021 16:33:28 -0400 Subject: finished up unit tests and added system tests --- .../edu/brown/cs/student/SuspicionRankerTest.java | 38 +++++++++++++++++++--- 1 file changed, 34 insertions(+), 4 deletions(-) (limited to 'src/test/java/edu/brown/cs') 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 vals = r.getSuspicionScoreList(start, end); + assertTrue(vals.isEmpty()); + tearDown(); + + } + + @Test + public void testBadDates(){ + setUp(); + SuspicionRanker r = new SuspicionRanker(db); + List vals = r.getSuspicionScoreList(end, start); + assertTrue(vals.isEmpty()); + tearDown(); + + } + } -- cgit v1.2.3-70-g09d2