public void ParseToKontoEntriesFromRedPdfTest() { var expected = 49; // Arrange var fileFullPath = @"C:\Files\Dropbox\budget\Program\TestData\Allkortsfaktura 629 011 192 Oktober 2015.pdf" ; var tearget = new KontoFromPdfParser(fileFullPath); // Act var results = tearget.ParseToKontoEntriesFromRedPdf(); // Assert Assert.IsNotNull(results); Assert.AreEqual(expected, results.Count); }
private void loadEntriesFromPdfFileToolStripMenuItem_Click(object sender, EventArgs e) { toolStripStatusLabel1.Text = @"Processing from Pdf"; //fileNkameGetter var selectFileDialog = new OpenFileDialog(); //var selectFileDialog = new FolderBrowserDialog(); Stream fileStream = null; if (selectFileDialog.ShowDialog() == DialogResult.OK) //&& (fileStream = selectFileDialog..OpenFile()) != null) { string fileName = selectFileDialog.FileName; //.SelectedPath; // .FileName; //using (fileStream) //{ // // TODO //} if (!string.IsNullOrEmpty(fileName)) { var pdfParser = new KontoFromPdfParser(fileName); var rows = pdfParser.ParseToKontoEntriesFromRedPdf(); var somethingLoadeded = LoadKonton.GetAllEntriesFromPdfFile( kontoEntriesHolder, rows); if (somethingLoadeded) { CheckAndAddNewItems(); toolStripStatusLabel1.Text = @"Done processing entries from Pdf. New Entries found; " + kontoEntriesHolder.NewKontoEntries.Count + @"."; } else { // Done, meddela på nåt sätt att det är klart, och antal inlästa, i tex. statusbar toolStripStatusLabel1.Text = @"Done processing no new entries fond from html."; } } } }