package ca.ualberta.cs.cmput301t02project.test;

import junit.framework.TestCase;
import ca.ualberta.cs.cmput301t02project.controller.FavoritesController;
import ca.ualberta.cs.cmput301t02project.model.CommentListModel;
import ca.ualberta.cs.cmput301t02project.model.CommentModel;

public class FavoritesControllerTest extends TestCase {
	
	FavoritesController controller;
	CommentListModel model;
	
	public FavoritesControllerTest(String name) {
		super(name);
	}
	
	protected void setUp() throws Exception {
		super.setUp();
		model = new CommentListModel();
		controller = new FavoritesController(model);
	}
	
	// Use Case 11 - KW 
	public void favoriteCommentTest() {
		CommentModel comment = new CommentModel("original text", null ,"username");
		controller.favoriteComment(comment);
		assertTrue(model.getCommentList().contains(comment));
	}
		
		
}
	
	
	
	
	



@@ -641,17 +641,21 @@
 ic void 
-f
+testF
 avoriteC
@@ -660,20 +660,16 @@
 eComment
-Test
 () %7B%0A%09%09C
@@ -749,98 +749,163 @@
 ;%0A%09%09
-controller.favoriteComment(comment);%0A%09%09assertTrue(model.getCommentList().contains(comment)
+int oldRating = comment.getRating();%0A%09%09controller.favoriteComment(comment);%0A%09%09int newRating = comment.getRating(); %0A%09%09assertEquals((oldRating+1), newRating
 );%0A%09

test for checking if favorite added fails properly now