Example #1
0
        public void Ban_ReturnsIActionResult_WithCommentIdAndBanDuration()
        {
            // Act
            var result = _commentController.Ban(Guid.Empty, BanDuration.OneDay) as IActionResult;

            // Assert
            Assert.NotNull(result);
        }
Example #2
0
        public void BanComment_UserIdAndPeriod_RedirectToActionResult()
        {
            _commentService.Setup(service => service.Ban(It.IsAny <BanPeriod>(), It.IsAny <Guid>()));

            var res = _sut.Ban(BanPeriod.Day, _fakeGameKey) as RedirectToRouteResult;

            Assert.Equal("Comment", res.RouteValues["controller"]);
            Assert.Equal("GetAllCommentToGame", res.RouteValues["action"]);
        }