Ejemplo n.º 1
0
        public void TestGetBooksByIDMethod()
        {
            BooksSqlDAL booksSqlDal = new BooksSqlDAL();
            BookModel   bookByID    = booksSqlDal.GetBooksById(bookId);

            Assert.IsNotNull(bookByID);
            Assert.AreEqual("The Test Title", bookByID.Title.ToString());
        }
Ejemplo n.º 2
0
        public void TestGetNewAuthorList()
        {
            BooksSqlDAL   booksSqldal = new BooksSqlDAL();
            List <String> authorList  = booksSqldal.GetNewAuthorList();

            Assert.IsNotNull(authorList);
            Assert.AreEqual(1, authorList.Count);
        }
Ejemplo n.º 3
0
        public void TestGetBooksMethod_TestByCharacter()
        {
            BooksSqlDAL      booksSqlDal = new BooksSqlDAL();
            List <BookModel> books       = booksSqlDal.GetBooks("Test", "Character");

            Assert.IsNotNull(books);
            Assert.AreEqual(1, books.Count);
        }
Ejemplo n.º 4
0
        public void TestGetNewBookList()
        {
            BooksSqlDAL      booksSqlDal = new BooksSqlDAL();
            List <BookModel> booksList   = booksSqlDal.GetNewBookList();

            Assert.IsNotNull(booksList);
            Assert.AreEqual(1, booksList.Count);
        }
Ejemplo n.º 5
0
        public void TestAddNewBook()
        {
            BooksSqlDAL dal   = new BooksSqlDAL();
            BookModel   model = new BookModel();

            model.Author        = "Stuk, Gina";
            model.Title         = "";
            model.MainCharacter = "Detective Brandon";
            model.Setting       = "Cleveland, OH";
            model.Genre         = "Mystery";
            model.Description   = "Lorem";
            model.ImageLink     = "https://images-na.ssl-images";


            bool isAdded = dal.AddNewBook(model);


            Assert.IsTrue(isAdded);
        }