use of com.qcadoo.commons.dateTime.DateRange in project mes by qcadoo.
the class OrderDatesServiceTest method shouldReturnDateRangeWithEffectiveEndDate4.
@Test
public final void shouldReturnDateRangeWithEffectiveEndDate4() {
// given
Date effectiveEndDate = new DateTime(2013, 2, 8, 0, 0, 0, 0).toDate();
stubDateField(order, OrderFields.EFFECTIVE_DATE_TO, effectiveEndDate);
// when
DateRange dateRange = orderDatesService.getCalculatedDates(order);
// then
assertNull(dateRange.getFrom());
assertEquals(effectiveEndDate, dateRange.getTo());
}
use of com.qcadoo.commons.dateTime.DateRange in project mes by qcadoo.
the class OrderDatesServiceTest method shouldReturnDateRangeWithEffectiveEndDate.
@Test
public final void shouldReturnDateRangeWithEffectiveEndDate() {
// given
Date plannedEndDate = new DateTime(2013, 1, 1, 0, 0, 0, 0).toDate();
stubDateField(order, OrderFields.DATE_TO, plannedEndDate);
Date correctedEndDate = new DateTime(2013, 1, 5, 0, 0, 0, 0).toDate();
stubDateField(order, OrderFields.CORRECTED_DATE_TO, correctedEndDate);
Date effectiveEndDate = new DateTime(2013, 2, 8, 0, 0, 0, 0).toDate();
stubDateField(order, OrderFields.EFFECTIVE_DATE_TO, effectiveEndDate);
// when
DateRange dateRange = orderDatesService.getCalculatedDates(order);
// then
assertNull(dateRange.getFrom());
assertEquals(effectiveEndDate, dateRange.getTo());
}
use of com.qcadoo.commons.dateTime.DateRange in project mes by qcadoo.
the class OrderDatesServiceTest method shouldReturnDateRangeWithPlannedStartAndPlannedEndDate.
@Test
public final void shouldReturnDateRangeWithPlannedStartAndPlannedEndDate() {
// given
Date plannedStartDate = new DateTime(2012, 12, 30, 0, 0, 0, 0).toDate();
stubDateField(order, OrderFields.DATE_FROM, plannedStartDate);
Date plannedEndDate = new DateTime(2013, 1, 1, 0, 0, 0, 0).toDate();
stubDateField(order, OrderFields.DATE_TO, plannedEndDate);
// when
DateRange dateRange = orderDatesService.getCalculatedDates(order);
// then
assertEquals(plannedStartDate, dateRange.getFrom());
assertEquals(plannedEndDate, dateRange.getTo());
}
use of com.qcadoo.commons.dateTime.DateRange in project mes by qcadoo.
the class OrderDatesServiceTest method shouldReturnDateRangeWithEffectiveStartDate4.
@Test
public final void shouldReturnDateRangeWithEffectiveStartDate4() {
// given
Date effectiveStartDate = new DateTime(2013, 2, 8, 0, 0, 0, 0).toDate();
stubDateField(order, OrderFields.EFFECTIVE_DATE_FROM, effectiveStartDate);
// when
DateRange dateRange = orderDatesService.getCalculatedDates(order);
// then
assertEquals(effectiveStartDate, dateRange.getFrom());
assertNull(dateRange.getTo());
}
use of com.qcadoo.commons.dateTime.DateRange in project mes by qcadoo.
the class OrderDatesServiceTest method shouldReturnDateRangeWithPlannedEndDate.
@Test
public final void shouldReturnDateRangeWithPlannedEndDate() {
// given
Date plannedEndDate = new DateTime(2013, 1, 1, 0, 0, 0, 0).toDate();
stubDateField(order, OrderFields.DATE_TO, plannedEndDate);
// when
DateRange dateRange = orderDatesService.getCalculatedDates(order);
// then
assertNull(dateRange.getFrom());
assertEquals(plannedEndDate, dateRange.getTo());
}
Aggregations