Search in sources :

Example 1 with Cleaning

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);
}
Also used : CleaningEntry(com.github.drbookings.ui.CleaningEntry) Cleaning(com.github.drbookings.model.data.Cleaning) Test(org.junit.Test)

Example 2 with Cleaning

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);
}
Also used : CleaningEntry(com.github.drbookings.ui.CleaningEntry) Cleaning(com.github.drbookings.model.data.Cleaning) BookingBean(com.github.drbookings.model.data.BookingBean)

Example 3 with Cleaning

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));
}
Also used : CleaningEntry(com.github.drbookings.ui.CleaningEntry) Cleaning(com.github.drbookings.model.data.Cleaning) Test(org.junit.Test)

Aggregations

Cleaning (com.github.drbookings.model.data.Cleaning)3 CleaningEntry (com.github.drbookings.ui.CleaningEntry)3 Test (org.junit.Test)2 BookingBean (com.github.drbookings.model.data.BookingBean)1