public void Post_CommentForPostTest_ValidExecutionOfTheMethod()
        {
            FakeRepository<Post> postFakeRepository = new FakeRepository<Post>();
            FakeRepository<User> userFakeRepository = new FakeRepository<User>();
            FakeRepository<Thread> threadFakeRepository = new FakeRepository<Thread>();
            FakeRepository<Vote> voteFakeRepository = new FakeRepository<Vote>();
            FakeRepository<Comment> commentFakeRepository = new FakeRepository<Comment>();

            User user = new User()
            {
                AuthCode = "0123456789012345678901234567890123456789",
                Username = "******",
                Nickname = "TestNickname",
                SessionKey = "0SuGqVGqRwitYtijDvHlVfHGotklitbwHdYFkgwIRcIQjRASPQ"
            };

            Thread thread = new Thread()
            {
                Title = "Test title",
                Creator = user,
                Content = "Test Content",
                DateCreated = DateTime.Now
            };

            Post post = new Post()
            {
                Content = "Test post content",
                DateCreated = DateTime.Now,
                User = user,
                Thread = thread
            };

            CommentModel commentModel = new CommentModel()
            {
                Content = "Just some test content",
                CommentDate = DateTime.Now
            };

            userFakeRepository.entities.Add(user);
            threadFakeRepository.entities.Add(thread);
            postFakeRepository.entities.Add(post);

            PostsController postsController = new PostsController(
                postFakeRepository, userFakeRepository, threadFakeRepository, voteFakeRepository, commentFakeRepository);

            SetupController(postsController);

            var response = postsController.CommentForPost(commentModel, post.Id, user.SessionKey);
            int expectedCommentCount = 1;

            Assert.AreEqual(HttpStatusCode.Created, response.StatusCode);
            Assert.AreEqual(expectedCommentCount, commentFakeRepository.entities.Count);
        }
        public void Post_CommentForPostTest_InvalidSessionKey_NoUserWithSuchSessionKey()
        {
            FakeRepository<Post> postFakeRepository = new FakeRepository<Post>();
            FakeRepository<User> userFakeRepository = new FakeRepository<User>();
            FakeRepository<Thread> threadFakeRepository = new FakeRepository<Thread>();
            FakeRepository<Vote> voteFakeRepository = new FakeRepository<Vote>();
            FakeRepository<Comment> commentFakeRepository = new FakeRepository<Comment>();

            User user = new User()
            {
                AuthCode = "0123456789012345678901234567890123456789",
                Username = "******",
                Nickname = "TestNickname",
                SessionKey = "0SuGqVGqRwitYtijDvHlVfHGotklitbwHdYFkgwIRcIQjRASPQ"
            };

            Thread thread = new Thread()
            {
                Title = "Test title",
                Creator = user,
                Content = "Test Content",
                DateCreated = DateTime.Now
            };

            Post post = new Post()
            {
                Content = "Test post content",
                DateCreated = DateTime.Now,
                User = user,
                Thread = thread
            };

            CommentModel commentModel = new CommentModel()
            {
                Content = "Just a test comment.",
                CommentDate = DateTime.Now
            };

            userFakeRepository.entities.Add(user);
            threadFakeRepository.entities.Add(thread);
            postFakeRepository.entities.Add(post);

            PostsController postsController = new PostsController(
                postFakeRepository, userFakeRepository, threadFakeRepository, voteFakeRepository, commentFakeRepository);

            SetupController(postsController);

            var response = postsController.CommentForPost(commentModel, post.Id, "1InvalidSessionKeyvHlVfHGotklitbwHdYFkgwIRcIQjRAPQ");
        }