source: osm/applications/editors/josm/plugins/indoorhelper/test/unit/PresetCounterTest.java@ 32954

Last change on this file since 32954 was 32637, checked in by donvip, 9 years ago

checkstyle

File size: 1.3 KB
Line 
1import static org.junit.Assert.assertEquals;
2
3import java.util.ArrayList;
4import java.util.List;
5
6import org.junit.Test;
7
8import model.PresetCounter;
9import model.TagCatalog.IndoorObject;
10
11public class PresetCounterTest {
12
13 /**
14 * Test case for testing the ranking functionality.
15 */
16 @Test
17 public void testRanking() {
18 // input preparation
19 PresetCounter counter = new PresetCounter();
20
21 counter.count(IndoorObject.CONCRETE_WALL);
22 counter.count(IndoorObject.CONCRETE_WALL);
23 counter.count(IndoorObject.CONCRETE_WALL);
24 counter.count(IndoorObject.ROOM);
25 counter.count(IndoorObject.ROOM);
26 counter.count(IndoorObject.STEPS);
27 counter.count(IndoorObject.TOILET_MALE);
28
29 List<IndoorObject> actualList = counter.getRanking();
30
31 //expectation
32 List<IndoorObject> expectedList = new ArrayList<>();
33 expectedList.add(IndoorObject.CONCRETE_WALL);
34 expectedList.add(IndoorObject.ROOM);
35 expectedList.add(IndoorObject.TOILET_MALE);
36 expectedList.add(IndoorObject.STEPS);
37
38
39 //assertion
40 assertEquals(expectedList.get(0), actualList.get(0));
41 assertEquals(expectedList.get(1), actualList.get(1));
42 assertEquals(expectedList.get(2), actualList.get(2));
43 assertEquals(expectedList.get(3), actualList.get(3));
44
45
46 }
47}
Note: See TracBrowser for help on using the repository browser.