@Test public void partWithOneDebtNoUnit() { final Donation donation = new Donation("test", getRnD(), getBob(), getEuro(), BigDecimal.TEN, 0); new Debt(getBob(), donation, 1); assertEquals(BigDecimal.TEN, donation.getPartCost()); }
@Test public void partWithTwoDebtsNoUnit() { final Donation donation = new Donation("test", getRnD(), getBob(), getEuro(), BigDecimal.TEN, 0); new Debt(getBob(), donation, 2); assertEquals(2, donation.getTakenUnit()); assertEquals(BigDecimal.valueOf(5), donation.getPartCost()); }
@Test public void partCost() { final Donation donation = new Donation("test", getRnD(), getBob(), getEuro(), BigDecimal.TEN, 10); assertEquals(BigDecimal.ONE, donation.getPartCost()); }
@Test public void partCostForFreeDonation() { final Donation donation = new Donation("test", getRnD(), getBob(), getEuro(), null, 0); assertEquals(BigDecimal.ZERO, donation.getPartCost()); }