diff options
| author | Julia McCauley <skurvyj@gmail.com> | 2021-04-16 16:33:28 -0400 |
|---|---|---|
| committer | Julia McCauley <skurvyj@gmail.com> | 2021-04-16 16:33:28 -0400 |
| commit | 7cf6c2b08add62df693a9a2e2c1ee0ed6f0c5aee (patch) | |
| tree | c71da7e69c856eecc35e5bb4f848232846c68bc9 /src/test/java/edu/brown/cs/student/SuspicionRankerTest.java | |
| parent | 66406a64a5a0d56f3cd74b4cdba76a1c929847ab (diff) | |
finished up unit tests and added system tests
Diffstat (limited to 'src/test/java/edu/brown/cs/student/SuspicionRankerTest.java')
| -rw-r--r-- | src/test/java/edu/brown/cs/student/SuspicionRankerTest.java | 38 |
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(); + + } + } |
