コード例 #1
0
        public void CountMarkTwainBooksTest()
        {
            Services.Library.BookList target = new Data.Library.GlobalBookLists().OneThousandNovelsEveryMustRead();
            var twainBooks = (from book in target.Books
                              join bookcreator in target.BookCreators on
                              book.BookId equals bookcreator.BookId
                              join creator in target.Creators on
                              bookcreator.CreatorId equals creator.CreatorId
                              where creator.Fullname.ToUpper().Contains("Twain".ToUpper())
                              select new { book.Title, creator.Fullname }).ToList();

            Assert.AreEqual(twainBooks.Count(), 5);
        }
コード例 #2
0
 public void GlobalBookListsConstructorTest()
 {
     Data.Library.GlobalBookLists target = new Data.Library.GlobalBookLists();
     Assert.IsNotNull(target);
 }
コード例 #3
0
 public void OneThousandNovelsEveryMustReadTest()
 {
     Data.Library.GlobalBookLists target = new Data.Library.GlobalBookLists();
     Assert.AreEqual(1000, target.OneThousandNovelsEveryMustRead().Books.Count, "Thre are not 1000 books in the list");
 }
コード例 #4
0
 public void CountCreatorsTest()
 {
     Services.Library.BookList target = new Data.Library.GlobalBookLists().OneThousandNovelsEveryMustRead();
     Assert.AreEqual(target.Creators.Count(), 684);
 }