@Test public void testNewUserInData() throws TasteException { int howMany = 4; List<RecommendedItem> recommendation = Reco._internalRecommend(howMany, new User(10l), usersData()); assertTrue(recommendation.size() == howMany); }
@Test public void testUserWithOnlyOneUniquePref() throws TasteException { int howMany = 4; List<RecommendedItem> recommendation = Reco._internalRecommend(howMany, new User(12l), usersData()); assertTrue(recommendation.size() == howMany); }
@Test public void testRecommendation() throws TasteException { int howMany = 4; List<RecommendedItem> recommendation = Reco._internalRecommend(howMany, new User(0l), usersData()); assertTrue(recommendation.size() <= howMany); assertEquals(ITEM_9, (Long) recommendation.get(0).getItemID()); assertEquals(ITEM_7, (Long) recommendation.get(1).getItemID()); assertEquals(ITEM_6, (Long) recommendation.get(2).getItemID()); assertEquals(ITEM_11, (Long) recommendation.get(3).getItemID()); }