public void Detailed() { // Arrange BookController controller = new BookController(booksServiceMock.Object, pagesServiceMock.Object, pageConnectionsServiceMock.Object); int id = 1; Mock <Book> bookMock = new Mock <Book>(); // Act booksServiceMock.Setup(x => x.FindSingle(id)).Returns(bookMock.Object); ViewResult result = controller.Detailed(id) as ViewResult; // Assert Assert.IsNotNull(result); }