public void GetBook_ShouldNotFindBook() { var controller = new SimpleBookController(GetTestBooks()); var result = controller.GetBook(999); Assert.IsInstanceOfType(result, typeof(NotFoundResult)); }
public void GetBook_ShouldReturnCorrectBook() { var testBooks = GetTestBooks(); var controller = new SimpleBookController(testBooks); var result = controller.GetBook(4) as OkNegotiatedContentResult <Book>; Assert.IsNotNull(result); Assert.AreEqual(testBooks[3].Name, result.Content.Name); }