Beispiel #1
0
        public void TestFindMissingBooks()
        {
            List <BookMetadata> booksMissingInDatabase, booksMissingOnFilesystem;

            CleanerService.findMissingBooks(TestdataPath, out booksMissingInDatabase, out booksMissingOnFilesystem);
            Assert.AreEqual(12, booksMissingInDatabase.Count);
            Assert.AreEqual(5, booksMissingOnFilesystem.Count);
        }
Beispiel #2
0
 public void TestNoCalibreDatabasePresent()
 {
     try
     {
         List <BookMetadata> booksMissingInDatabase, booksMissingOnFilesystem;
         CleanerService.findMissingBooks("non-existant-path", out booksMissingInDatabase, out booksMissingOnFilesystem);
     }
     catch (CleanerServiceException e)
     {
         Assert.AreEqual("Could not open a \"metadata.db\" database file in the specified path", e.Message);
         throw;
     }
 }
 private void SubmitButton_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         List <BookMetadata> booksMissingInDatabase, booksMissingOnFilesystem;
         CleanerService.findMissingBooks(pathTextBox.Text, out booksMissingInDatabase, out booksMissingOnFilesystem);
         missingFromDatabaseDataGrid.ItemsSource   = booksMissingInDatabase;
         missingFromFilesystemDataGrid.ItemsSource = booksMissingOnFilesystem;
     }
     catch (Exception ex)
     {
         System.Windows.MessageBox.Show(ex.Message, "An error has occurred");
     }
 }