コード例 #1
0
        public void GetBookInformationTest()
        {
            // calling external Restfull service (ISBNDB)
            Book book = ISBNDBService.GetBookInformation("0061031321");

            Assert.AreEqual("Thief of time", book.Title);
        }
コード例 #2
0
 // GET: Books/Create
 public ActionResult Create(string searchString)
 {
     if (!String.IsNullOrEmpty(searchString))
     {
         // calling external Restfull service (ISBNDB)
         Book book = ISBNDBService.GetBookInformation(searchString);
         if (book == null)
         {
             // TODO: ERROR/EXCEPTION HANDLING
             return(HttpNotFound());
         }
         book.ISBN = searchString;
         return(View(book));
     }
     return(View());
 }