]> git.basschouten.com Git - openhab-addons.git/blob
402ac0212320daa990002a4e319663d93f43e115
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 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.nibeheatpump.internal.models;
14
15 import static org.junit.jupiter.api.Assertions.*;
16
17 import org.junit.jupiter.api.BeforeEach;
18 import org.junit.jupiter.api.Test;
19
20 /**
21  * @author Pauli Anttila - Initial contribution
22  */
23 public class PumpModelTest {
24
25     @BeforeEach
26     public void Before() {
27     }
28
29     @Test
30     public void TestF1X45() {
31         final String pumpModelString = "F1X45";
32         final PumpModel pumpModel = PumpModel.getPumpModel(pumpModelString);
33         assertEquals(PumpModel.F1X45, pumpModel);
34     }
35
36     @Test
37     public void TestF1X55() {
38         final String pumpModelString = "F1X55";
39         final PumpModel pumpModel = PumpModel.getPumpModel(pumpModelString);
40         assertEquals(PumpModel.F1X55, pumpModel);
41     }
42
43     @Test
44     public void TestF750() {
45         final String pumpModelString = "F750";
46         final PumpModel pumpModel = PumpModel.getPumpModel(pumpModelString);
47         assertEquals(PumpModel.F750, pumpModel);
48     }
49
50     @Test
51     public void TestF470() {
52         final String pumpModelString = "F470";
53         final PumpModel pumpModel = PumpModel.getPumpModel(pumpModelString);
54         assertEquals(PumpModel.F470, pumpModel);
55     }
56
57     @Test
58     public void badPumpModelTest() {
59         assertThrows(IllegalArgumentException.class, () -> PumpModel.getPumpModel("XXXX"));
60     }
61 }