Beispiel #1
0
        public void ShouldNotFindBook()
        {
            var controller = new ValuesController(GetBooks());
            var result     = controller.GetBook(100);

            Assert.IsInstanceOfType(result, typeof(NotFoundResult));
        }
Beispiel #2
0
        public void GetBookById()
        {
            var listBooks  = GetBooks();
            var controller = new ValuesController(GetBooks());
            var result     = controller.GetBook(1) as OkNegotiatedContentResult <Books>;

            Assert.IsNotNull(result);
            Assert.AreEqual(listBooks[0].Name, result.Content.Name);
        }