]> git.basschouten.com Git - openhab-addons.git/blob
6df83c22f1bc60f967945b6c8182a7ba4c85d67c
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2021 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.ahawastecollection.internal;
14
15 import static org.junit.jupiter.api.Assertions.assertEquals;
16
17 import java.util.Map;
18
19 import org.eclipse.jdt.annotation.NonNullByDefault;
20 import org.junit.jupiter.api.Test;
21 import org.openhab.binding.ahawastecollection.internal.CollectionDate.WasteType;
22
23 /**
24  * @author Sönke Küper - Initial contribution
25  */
26 @NonNullByDefault
27 public class AhaCollectionScheduleTest {
28
29     @Test
30     public void testGetValuesForHannoverCity() throws Exception {
31         final AhaCollectionScheduleImpl schedule = new AhaCollectionScheduleImpl("Hannover",
32                 "02095@Oesterleystr.+/+Südstadt@Südstadt", "10", "", "02095-0010+");
33         final Map<WasteType, CollectionDate> dates = schedule.getCollectionDates();
34         // No bio waste is collected here
35         assertEquals(3, dates.size());
36     }
37
38     @Test
39     public void testGetValuesForRegion() throws Exception {
40         final AhaCollectionScheduleImpl schedule = new AhaCollectionScheduleImpl("Lehrte",
41                 "70185@Haselnussweg+/+Hämelerwald@Hämelerwald", "12", "", "70185-0012+");
42         final Map<WasteType, CollectionDate> dates = schedule.getCollectionDates();
43         // All four waste types are collected here.
44         assertEquals(4, dates.size());
45     }
46 }