use of name.abuchen.portfolio.datatransfer.pdf.INGDiBaExtractor in project portfolio by buchen.
the class INGDiBaPDFExtractorTest method testGemeinschaftskontoDividendengutschrift1.
@Test
public void testGemeinschaftskontoDividendengutschrift1() throws IOException {
INGDiBaExtractor extractor = new INGDiBaExtractor(new Client());
List<Exception> errors = new ArrayList<>();
List<Item> results = extractor.extract(PDFInputFile.loadTestCase(getClass(), "INGDiBa_Gemeinschaftskonto_Dividendengutschrift1.txt"), errors);
assertThat(errors, empty());
assertThat(results.size(), is(2));
Security security = results.stream().filter(i -> i instanceof SecurityItem).findFirst().get().getSecurity();
assertThat(security.getIsin(), is("DE000TLX1005"));
assertThat(security.getWkn(), is("TLX100"));
assertThat(security.getName(), is("Talanx AG Namens-Aktien o.N."));
AccountTransaction t = (AccountTransaction) results.stream().filter(i -> i instanceof TransactionItem).findFirst().get().getSubject();
assertThat(t.getType(), is(AccountTransaction.Type.DIVIDENDS));
assertThat(t.getAmount(), is(Values.Amount.factorize(468.04)));
assertThat(t.getDateTime(), is(LocalDateTime.parse("2016-05-12T00:00")));
assertThat(t.getShares(), is(Values.Share.factorize(500)));
assertThat(t.getGrossValue(), is(Money.of(CurrencyUnit.EUR, Values.Amount.factorize(650.00))));
assertThat(t.getUnitSum(Unit.Type.TAX), is(Money.of(CurrencyUnit.EUR, Values.Amount.factorize(79.46 + 7.15 + 4.37 + 79.46 + 7.15 + 4.37))));
}
use of name.abuchen.portfolio.datatransfer.pdf.INGDiBaExtractor in project portfolio by buchen.
the class INGDiBaPDFExtractorTest method testWertpapierVerkauf2.
@Test
public void testWertpapierVerkauf2() throws IOException {
INGDiBaExtractor extractor = new INGDiBaExtractor(new Client());
List<Exception> errors = new ArrayList<Exception>();
List<Item> results = extractor.extract(PDFInputFile.loadTestCase(getClass(), "INGDiBa_Verkauf2.txt"), errors);
assertThat(errors, empty());
assertThat(results.size(), is(2));
// check security
Security security = results.stream().filter(i -> i instanceof SecurityItem).findFirst().get().getSecurity();
assertThat(security.getIsin(), is("DE0002635281"));
assertThat(security.getWkn(), is("263528"));
assertThat(security.getName(), is("iSh.EO ST.Sel.Div.30 U.ETF DE"));
// check buy sell transaction
BuySellEntry entry = (BuySellEntry) results.stream().filter(i -> i instanceof BuySellEntryItem).findFirst().get().getSubject();
assertThat(entry.getPortfolioTransaction().getType(), is(PortfolioTransaction.Type.SELL));
assertThat(entry.getAccountTransaction().getType(), is(AccountTransaction.Type.SELL));
assertThat(entry.getPortfolioTransaction().getAmount(), is(Values.Amount.factorize(568.41)));
assertThat(entry.getPortfolioTransaction().getDateTime(), is(LocalDateTime.parse("2016-12-22T00:00")));
assertThat(entry.getPortfolioTransaction().getShares(), is(Values.Share.factorize(30)));
assertThat(entry.getPortfolioTransaction().getUnitSum(Unit.Type.FEE), is(Money.of("EUR", 9_90L)));
assertThat(entry.getPortfolioTransaction().getUnitSum(Unit.Type.TAX), is(Money.of("EUR", 19_32)));
}
use of name.abuchen.portfolio.datatransfer.pdf.INGDiBaExtractor in project portfolio by buchen.
the class INGDiBaPDFExtractorTest method testWertpapierKauf3.
@Test
public void testWertpapierKauf3() throws IOException {
INGDiBaExtractor extractor = new INGDiBaExtractor(new Client());
List<Exception> errors = new ArrayList<Exception>();
List<Item> results = extractor.extract(PDFInputFile.loadTestCase(getClass(), "INGDiBa_Kauf3.txt"), errors);
assertThat(errors, empty());
assertThat(results.size(), is(2));
// check security
Security security = results.stream().filter(i -> i instanceof SecurityItem).findFirst().get().getSecurity();
assertThat(security.getIsin(), is("XS0138973010"));
assertThat(security.getWkn(), is("778998"));
assertThat(security.getName(), is("7,125 % Aareal Bank Capital Fdg Trust"));
// check buy sell transaction
BuySellEntry entry = (BuySellEntry) results.stream().filter(i -> i instanceof BuySellEntryItem).findFirst().get().getSubject();
assertThat(entry.getPortfolioTransaction().getType(), is(PortfolioTransaction.Type.BUY));
assertThat(entry.getAccountTransaction().getType(), is(AccountTransaction.Type.BUY));
assertThat(entry.getPortfolioTransaction().getAmount(), is(Values.Amount.factorize(1027.40)));
assertThat(entry.getPortfolioTransaction().getDateTime(), is(LocalDateTime.parse("2015-11-06T00:00")));
assertThat(entry.getPortfolioTransaction().getShares(), is(Values.Share.factorize(40)));
assertThat(entry.getPortfolioTransaction().getUnitSum(Unit.Type.FEE), is(Money.of("EUR", 2_50L + 9_90L + 3_00L)));
}
use of name.abuchen.portfolio.datatransfer.pdf.INGDiBaExtractor in project portfolio by buchen.
the class INGDiBaPDFExtractorTest method testWertpapierKauf2.
@Test
public void testWertpapierKauf2() throws IOException {
INGDiBaExtractor extractor = new INGDiBaExtractor(new Client());
List<Exception> errors = new ArrayList<Exception>();
List<Item> results = extractor.extract(PDFInputFile.loadTestCase(getClass(), "INGDiBa_Kauf2.txt"), errors);
assertThat(errors, empty());
assertThat(results.size(), is(2));
// check security
Security security = results.stream().filter(i -> i instanceof SecurityItem).findFirst().get().getSecurity();
assertThat(security.getIsin(), is("DE0002635307"));
assertThat(security.getWkn(), is("263530"));
assertThat(security.getName(), is("iSh.STOXX Europe 600 U.ETF DE"));
// check buy sell transaction
BuySellEntry entry = (BuySellEntry) results.stream().filter(i -> i instanceof BuySellEntryItem).findFirst().get().getSubject();
assertThat(entry.getPortfolioTransaction().getType(), is(PortfolioTransaction.Type.BUY));
assertThat(entry.getAccountTransaction().getType(), is(AccountTransaction.Type.BUY));
assertThat(entry.getPortfolioTransaction().getAmount(), is(Values.Amount.factorize(726.28)));
assertThat(entry.getPortfolioTransaction().getDateTime(), is(LocalDateTime.parse("2015-06-11T00:00")));
assertThat(entry.getPortfolioTransaction().getShares(), is(Values.Share.factorize(18)));
assertThat(entry.getPortfolioTransaction().getUnitSum(Unit.Type.FEE), is(Money.of("EUR", Values.Amount.factorize(0))));
}
use of name.abuchen.portfolio.datatransfer.pdf.INGDiBaExtractor in project portfolio by buchen.
the class INGDiBaPDFExtractorTest method testErtragsgutschrift2.
@Test
public void testErtragsgutschrift2() throws IOException {
INGDiBaExtractor extractor = new INGDiBaExtractor(new Client());
List<Exception> errors = new ArrayList<>();
List<Item> results = extractor.extract(PDFInputFile.loadTestCase(getClass(), "INGDiBa_Ertragsgutschrift2.txt"), errors);
assertThat(errors, empty());
assertThat(results.size(), is(2));
// check security
Security security = results.stream().filter(i -> i instanceof SecurityItem).findFirst().get().getSecurity();
assertThat(security.getIsin(), is("DE000A1PGUT9"));
assertThat(security.getWkn(), is("A1PGUT"));
assertThat(security.getName(), is("7,25000% posterXXL AG"));
// check buy sell transaction
AccountTransaction t = (AccountTransaction) results.stream().filter(i -> i instanceof TransactionItem).findFirst().get().getSubject();
assertThat(t.getType(), is(AccountTransaction.Type.DIVIDENDS));
assertThat(t.getAmount(), is(Values.Amount.factorize(72.50)));
assertThat(t.getDateTime(), is(LocalDateTime.parse("2015-12-15T00:00")));
assertThat(t.getShares(), is(Values.Share.factorize(0)));
}
Aggregations