Beispiel #1
0
        public void TestDeleteConfirmedRedirect()
        {
            // Arrange
            BookController controller = new BookController();

            // Act
            var bookList = db.BookTbls.ToList();

            Random rnd = new Random();
            int    r   = rnd.Next(1, bookList.Count);

            var selectedId = bookList[r].Id;
            var result     = controller.DeleteConfirmed(selectedId) as RedirectToRouteResult;

            // Assert
            Assert.AreEqual("Index", result.RouteValues["action"].ToString());
        }