use of io.jawg.osmcontributor.model.utils.OpeningMonth in project osm-contributor by jawg.
the class OpeningMonthValueParserTest method nonStop2.
@Test
public void nonStop2() {
OpeningMonth openingMonth = new OpeningMonth();
OpeningHours openingHours = new OpeningHours();
openingMonth.setMonthActivated(0, true);
openingMonth.setMonthActivated(1, true);
openingMonth.setMonthActivated(7, true);
openingMonth.setMonthActivated(8, true);
openingMonth.setMonthActivated(10, true);
openingMonth.addOpeningHours(openingHours);
openingHours.setDayActivated(0, true);
openingHours.setDayActivated(1, true);
openingHours.setDayActivated(2, true);
openingHours.setDayActivated(3, true);
openingHours.setDayActivated(4, true);
openingHours.setDayActivated(5, true);
openingHours.setDayActivated(6, true);
openingHours.setFromTime(new LocalTime(23, 59));
openingHours.setToTime(new LocalTime(23, 58));
Assert.assertEquals(parser.toValue(openingMonth), "Jan-Feb,Aug-Sep,Nov: 24/7");
}
use of io.jawg.osmcontributor.model.utils.OpeningMonth in project osm-contributor by jawg.
the class OpeningMonthValueParserTest method fromValue2.
@Test
public void fromValue2() {
String monthValue = "Feb-Mar,May-Jun,Aug-Sep,Nov";
OpeningMonth openingMonth = parser.fromValue(monthValue);
OpeningMonth o = new OpeningMonth();
o.setMonthActivated(1, true);
o.setMonthActivated(2, true);
o.setMonthActivated(4, true);
o.setMonthActivated(5, true);
o.setMonthActivated(7, true);
o.setMonthActivated(8, true);
o.setMonthActivated(10, true);
Assert.assertEquals(o, openingMonth);
}
use of io.jawg.osmcontributor.model.utils.OpeningMonth in project osm-contributor by jawg.
the class OpeningMonthValueParserTest method parseMonths3.
@Test
public void parseMonths3() {
OpeningMonth openingMonth = new OpeningMonth();
openingMonth.setMonthActivated(0, true);
openingMonth.setMonthActivated(2, true);
openingMonth.setMonthActivated(4, true);
openingMonth.setMonthActivated(5, true);
openingMonth.setMonthActivated(6, true);
openingMonth.setMonthActivated(7, true);
openingMonth.setMonthActivated(8, true);
openingMonth.setMonthActivated(10, true);
openingMonth.setMonthActivated(11, true);
openingMonth.setMonthActivated(4, false);
Assert.assertEquals(parser.toValue(openingMonth), "Jan,Mar,Jun-Sep,Nov-Dec");
}
use of io.jawg.osmcontributor.model.utils.OpeningMonth in project osm-contributor by jawg.
the class OpeningTimeValueParserTest method parseDays3.
@Test
public void parseDays3() {
OpeningTime openingTime = new OpeningTime();
OpeningMonth openingMonth = new OpeningMonth();
OpeningHours openingHours = new OpeningHours();
openingMonth.addOpeningHours(openingHours);
openingHours.setDayActivated(0, true);
openingHours.setDayActivated(1, true);
openingHours.setDayActivated(2, true);
openingHours.setDayActivated(3, true);
openingHours.setDayActivated(4, true);
openingHours.setDayActivated(5, true);
openingHours.setDayActivated(6, true);
openingHours.setDayActivated(5, false);
openingTime.addOpeningMonth(openingMonth);
Assert.assertEquals(parser.toValue(openingTime), "Mo-Fr,Su 08:00-18:00");
}
use of io.jawg.osmcontributor.model.utils.OpeningMonth in project osm-contributor by jawg.
the class OpeningTimeValueParserTest method parseOpeningHours1.
@Test
public void parseOpeningHours1() {
OpeningTime openingTime = new OpeningTime();
OpeningMonth openingMonth = new OpeningMonth();
OpeningHours openingHours1 = new OpeningHours();
OpeningHours openingHours2 = new OpeningHours();
openingMonth.addOpeningHours(openingHours1);
openingMonth.addOpeningHours(openingHours2);
openingMonth.setMonthActivated(2, true);
openingHours1.setAllDaysActivated(false);
openingHours1.setDayActivated(2, true);
openingHours2.setAllDaysActivated(false);
openingHours2.setDayActivated(5, true);
openingHours2.setFromTime(new LocalTime(5, 30));
openingHours2.setToTime(new LocalTime(17, 30));
openingTime.addOpeningMonth(openingMonth);
Assert.assertEquals(parser.toValue(openingTime), "Mar: We 08:00-18:00, Sa 05:30-17:30");
}
Aggregations