use of io.jawg.osmcontributor.model.utils.OpeningMonth in project osm-contributor by jawg.
the class OpeningTimeValueParserTest method parseOpeningHours2.
@Test
public void parseOpeningHours2() {
OpeningTime openingTime = new OpeningTime();
OpeningMonth openingMonth = new OpeningMonth();
OpeningHours openingHours1 = new OpeningHours();
OpeningHours openingHours2 = new OpeningHours();
OpeningHours openingHours3 = new OpeningHours();
openingMonth.addOpeningHours(openingHours1);
openingMonth.addOpeningHours(openingHours2);
openingMonth.addOpeningHours(openingHours3);
openingMonth.setMonthActivated(2, true);
openingMonth.setMonthActivated(3, true);
openingMonth.setMonthActivated(5, true);
openingMonth.setMonthActivated(6, true);
openingMonth.setMonthActivated(10, true);
openingHours1.setAllDaysActivated(false);
openingHours1.setDayActivated(2, true);
openingHours1.setDayActivated(4, true);
openingHours1.setDayActivated(5, true);
openingHours1.setFromTime(new LocalTime(10, 45));
openingHours1.setToTime(new LocalTime(19, 15));
openingHours2.setAllDaysActivated(false);
openingHours2.setDayActivated(5, true);
openingHours2.setDayActivated(6, true);
openingHours2.setDayActivated(1, true);
openingHours2.setFromTime(new LocalTime(5, 30));
openingHours2.setToTime(new LocalTime(17, 30));
openingHours3.setAllDaysActivated(false);
openingHours3.setDayActivated(2, true);
openingTime.addOpeningMonth(openingMonth);
Assert.assertEquals(parser.toValue(openingTime), "Mar-Apr,Jun-Jul,Nov: We,Fr-Sa 10:45-19:15, Tu,Sa-Su 05:30-17:30, We 08:00-18:00");
}
use of io.jawg.osmcontributor.model.utils.OpeningMonth in project osm-contributor by jawg.
the class OpeningTimeValueParserTest method parseDays1.
@Test
public void parseDays1() {
OpeningTime openingTime = new OpeningTime();
OpeningMonth openingMonth = new OpeningMonth();
OpeningHours openingHours = new OpeningHours();
openingHours.setAllDaysActivated(false);
openingHours.setDayActivated(0, true);
openingHours.setDayActivated(1, true);
openingHours.setDayActivated(6, true);
openingMonth.addOpeningHours(openingHours);
openingTime.addOpeningMonth(openingMonth);
Assert.assertEquals(parser.toValue(openingTime), "Mo-Tu,Su 08:00-18:00");
}
use of io.jawg.osmcontributor.model.utils.OpeningMonth in project osm-contributor by jawg.
the class OpeningTimeValueParserTest method parseMonthAndDays2.
@Test
public void parseMonthAndDays2() {
OpeningTime openingTime = new OpeningTime();
OpeningMonth openingMonth = new OpeningMonth();
OpeningHours openingHours = new OpeningHours();
openingHours.setAllDaysActivated(false);
openingMonth.addOpeningHours(openingHours);
openingMonth.setMonthActivated(2, true);
openingHours.setDayActivated(2, true);
openingTime.addOpeningMonth(openingMonth);
Assert.assertEquals(parser.toValue(openingTime), "Mar: We 08:00-18:00");
}
use of io.jawg.osmcontributor.model.utils.OpeningMonth in project osm-contributor by jawg.
the class OpeningMonthValueParserTest method parseMonths2.
@Test
public void parseMonths2() {
OpeningMonth openingMonth = new OpeningMonth();
openingMonth.setMonthActivated(5, true);
Assert.assertEquals(parser.toValue(openingMonth), "Jun");
}
use of io.jawg.osmcontributor.model.utils.OpeningMonth in project osm-contributor by jawg.
the class OpeningMonthValueParserTest method fromValue1.
@Test
public void fromValue1() {
String monthValue = "Jan-Apr,Sep";
OpeningMonth openingMonth = parser.fromValue(monthValue);
OpeningMonth o = new OpeningMonth();
o.setMonthActivated(0, true);
o.setMonthActivated(1, true);
o.setMonthActivated(2, true);
o.setMonthActivated(3, true);
o.setMonthActivated(8, true);
Assert.assertEquals(o, openingMonth);
}
Aggregations