Ejemplo n.º 1
0
        public void GetBook_ShouldNotFindBook()
        {
            var controller = new SimpleBookController(GetTestBooks());

            var result = controller.GetBook(999);

            Assert.IsInstanceOfType(result, typeof(NotFoundResult));
        }
Ejemplo n.º 2
0
        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);
        }