public void deleteCommentTest()
 {
     iCommentServices.Setup(m => m.deleteComment(It.IsAny<int>()));
     CommentController target = new CommentController(iCommentServices.Object, iLocationServices.Object);
     Random random = new Random();
     int commentId = random.Next();
     var actual = target.deleteComment(commentId) as RedirectToRouteResult;
     Assert.AreEqual(actual.RouteValues["action"], "index");
     Assert.AreEqual(actual.RouteValues["controller"], "Home");
     Assert.IsNotNull(actual);
 }
 public void addTextCommentTest()
 {
     iCommentServices.Setup(m => m.addComment(It.IsAny<Comments>()));
     CommentController target = new CommentController(iCommentServices.Object, iLocationServices.Object);
     Comments comment = new Comments();
     comment.description = "teste";
     var actual = target.addTextComment(comment, "Normal Mode") as RedirectToRouteResult;
     Assert.IsNotNull(actual);
     Assert.AreEqual(actual.RouteValues["action"], "index");
     Assert.AreEqual(actual.RouteValues["controller"], "Maps");
 }
 public void addTextCommentWithLocationTest()
 {
     iCommentServices.Setup(m => m.addComment(It.IsAny<Comments>()));
     CommentController target = new CommentController(iCommentServices.Object, iLocationServices.Object);
     Comments comment = new Comments();
     Random random = new Random();
     int locationId = random.Next();
     comment.description = "Teste";
     var actual = target.addTextCommentWithLocation(comment, locationId) as RedirectToRouteResult;
     Assert.IsNotNull(actual);
     Assert.AreEqual(actual.RouteValues["action"], "index");
     Assert.AreEqual(actual.RouteValues["controller"], "Maps");
 }
 public void editCommentTest()
 {
     iCommentServices.Setup(m=>m.findCommentByIdComment(It.IsAny<int>())).Returns(new Comments());
     CommentController target = new CommentController(iCommentServices.Object, iLocationServices.Object);
     int idComment = 1;
     var actual = target.editComment(idComment);
     Assert.IsNotNull(actual);
 }
 public void editCommentWithIdTest()
 {
     iCommentServices.Setup(m=>m.editCommentWithIdAndComment(It.IsAny<int>(),It.IsAny<string>()));
     iCommentServices.Setup(m => m.findCommentByIdComment(It.IsAny<int>())).Returns(new Comments());
     CommentController target = new CommentController(iCommentServices.Object,iLocationServices.Object);
     int commentId = 5;
     Comments comment = new Comments();
     comment.description = "Teste";
     comment.id = 1;
     var actual = target.editCommentWithId(commentId, comment,"Normal Mode") as RedirectToRouteResult;
     Assert.AreEqual(actual.RouteValues["action"], "index");
     Assert.AreEqual(actual.RouteValues["controller"], "Maps");
     Assert.IsNotNull(actual);
 }