예제 #1
0
        public void SQLDeleteBookTest()
        {
            int count      = db.GetBookCountByEntry(db.LookUpEntryIDByTitle("Pride and Prejudice"));
            int otherCount = db.GetBookCountByEntry(db.LookUpEntryIDByTitle("On the Bright Side"));

            db.DeleteBook(db.LookUpEntryIDByTitle("Pride and Prejudice"));
            db.DeleteBook(db.LookUpEntryIDByTitle("Pride and Prejudice"));
            db.SubmitToDatabase();

            Assert.AreEqual(count - 2, db.GetBookCountByEntry(db.LookUpEntryIDByTitle("Pride and Prejudice")));
            Assert.AreEqual(otherCount, db.GetBookCountByEntry(db.LookUpEntryIDByTitle("On the Bright Side")));
        }
예제 #2
0
 internal static void RemoveBookOfEntry(int entryId)
 {
     if (switchedOn)
     {
         db.DeleteBook(entryId);
     }
 }