예제 #1
0
        public void DeleteBookFromListTest()
        {
            var booklist = new BookList();
            var book     = new Book("Book", "Author", 2000, "isbn", Category.Drama);

            booklist.DeleteBook(book);
            Assert.Equal(0, booklist.Size());
        }
예제 #2
0
 private void delBtn_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (bookListView.SelectedIndex != -1)
         {
             bookList.DeleteBook(bookListView.SelectedIndex);
         }
     }
     catch
     {
         MessageBox.Show("Delete error occured.");
     }
 }