Exemplo n.º 1
0
 @Test
 public void testNewUserInData() throws TasteException {
   int howMany = 4;
   List<RecommendedItem> recommendation =
       Reco._internalRecommend(howMany, new User(10l), usersData());
   assertTrue(recommendation.size() == howMany);
 }
Exemplo n.º 2
0
 @Test
 public void testUserWithOnlyOneUniquePref() throws TasteException {
   int howMany = 4;
   List<RecommendedItem> recommendation =
       Reco._internalRecommend(howMany, new User(12l), usersData());
   assertTrue(recommendation.size() == howMany);
 }
Exemplo n.º 3
0
 @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());
 }