Example #1
0
        public void testTitleSearchReturns()
        {
            //arrange
            GoogleBookSearch testSearch = new GoogleBookSearch();

            //act
            IEnumerable <Models.Book> result = testSearch.TitleSearch("The Shining").Result;

            //assert
            Assert.IsNotNull(result);
            var book = result.FirstOrDefault(n => n.Title.Equals("The Shining"));

            Assert.IsNotNull(book);
        }
Example #2
0
        public void testTitleSearchReturnsNothing()
        {
            //arrange
            GoogleBookSearch testSearch = new GoogleBookSearch();

            //act
            Guid   guid       = Guid.NewGuid();
            String GuidString = guid.ToString();
            IEnumerable <Models.Book> result = testSearch.TitleSearch(GuidString).Result;

            //assert
            var GuidResult = result.Any(n => n.Title.Equals(GuidString));

            Assert.IsFalse(GuidResult);
        }