public void GivenUserBookReview_WhenDeleteBookReviewCalled_RedirectWithCorrectDetails()
        {
            // Arrange
            var fakeBookReview = A.Fake <UserBookReview>();

            fakeBookReview.BookId = 12;
            fakeBookReview.UserId = 10;

            A.CallTo(() => _fakeBookService.DeleteBookReview(fakeBookReview)).Returns(true);

            // Act
            var result = _bookController.DeleteBookReview(fakeBookReview) as RedirectToRouteResult;

            // Assert
            Assert.IsNotNull(result);
            var values = result.RouteValues.Values;
            var bookId = values.ElementAt(0);
            var userId = values.ElementAt(1);

            Assert.AreEqual(bookId, fakeBookReview.BookId);
            Assert.IsTrue(values.Contains(controllerName));
            Assert.IsTrue(values.Contains(actionCalledBookProfile));

            A.CallTo(() => _fakeBookService.DeleteBookReview(fakeBookReview)).MustHaveHappened(Repeated.Exactly.Once);
        }
        public void GivenValidBookReviewDetails_WhenDeleteReviewCalled_ReturnToBookProfile()
        {
            using (var scope = Container.BeginLifetimeScope())
            {
                // Arrange
                _bookController = scope.Resolve <BooksController>();
                BookService bookService = scope.Resolve <BookService>();

                UserBookReview userBookReview = new UserBookReview();
                userBookReview.UserId      = 289;
                userBookReview.BookId      = 11;
                userBookReview.Rating      = 5;
                userBookReview.Description = "Great book!";

                _bookController.CreateBookReview(userBookReview);

                // Act
                var result = _bookController.DeleteBookReview(userBookReview) as RedirectToRouteResult;

                // Assert
                Assert.IsNotNull(result);
                var values = result.RouteValues.Values;

                Assert.IsTrue(values.Contains(11));
                Assert.IsTrue(values.Contains(controllerName));
                Assert.IsTrue(values.Contains("BookProfile"));
                Assert.IsNull(bookService.GetABookReview(289, 11)); // cleanup, assert it's been successful
            }
        }