use of com.github.drbookings.model.data.Cleaning in project drbookings by DrBookings.
the class CleaningEntryTest method testEqualsHashCode01.
@Test
public void testEqualsHashCode01() {
final CleaningEntry ce1 = new CleaningEntry(LocalDate.now(), TestUtils.getTestBooking("tt"), new Cleaning("testCleaning"), null);
final CleaningEntry ce2 = new CleaningEntry(LocalDate.now(), TestUtils.getTestBooking("tt"), new Cleaning("testCleaning"), null);
assertEquals(ce1.hashCode(), ce2.hashCode());
assertEquals(ce1, ce2);
}
use of com.github.drbookings.model.data.Cleaning in project drbookings by DrBookings.
the class DefaultNetEarningsCalculatorTest method test.
@Test
public void test() {
final DefaultNetEarningsCalculator c = new DefaultNetEarningsCalculator();
final BookingBean b = TestUtils.getTestBooking(LocalDate.now(), LocalDate.now().plusDays(4));
b.setGrossEarningsExpression("360");
b.setServiceFee(0);
b.setServiceFeesPercent(12f);
b.setCleaningFees(60);
final CleaningEntry ce = new CleaningEntry(LocalDate.now(), b, new Cleaning("testCleaning"), null);
ce.setCleaningCosts(40);
b.setCleaning(ce);
assertEquals(360 - ((360 - 60) * 0.12), c.apply(b).doubleValue(), 0.001);
}
use of com.github.drbookings.model.data.Cleaning in project drbookings by DrBookings.
the class MainManagerTest method testAddCleaning01.
@Test
public void testAddCleaning01() {
mm = new MainManager();
final CleaningEntry ce = new CleaningEntry(LocalDate.now(), TestUtils.getTestBooking("tt"), new Cleaning("testCleaning"), null);
mm.addCleaning(LocalDate.now(), "testCleaning", TestUtils.getTestBooking("tt"));
assertTrue(mm.getCleaningEntries().contains(ce));
}
Aggregations