Esempio n. 1
0
        public void Mock_GetViewResultDeletePost_ActionResult()
        {
            //Arrange
            Dispose();
            DbSetup();
            ReviewController controller = new ReviewController(mock.Object);

            //Act
            var result = controller.DeleteConfirmed(1);

            //Assert
            Assert.IsInstanceOfType(result, typeof(RedirectToActionResult));
        }
Esempio n. 2
0
        public void ReviewControllerDeleteConfirmedReturnsView_ExpectedSuccess()
        {
            // Arrange
            var _mock = new Mock <IReviewLogic>();

            _mock.Setup(x => x.GetSingleReview(It.IsAny <Int32>())).ReturnsAsync(GetReview());
            var controllerUnderTest = new ReviewController(_context, _mock.Object);

            // Act
            var result = controllerUnderTest.DeleteConfirmed(1);

            // Assert
            var viewResult = Assert.IsType <Task <IActionResult> >(result);
        }