1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 package fr.ifremer.isisfish.types;
27
28 import static org.nuiton.i18n.I18n.t;
29
30 import java.util.LinkedList;
31 import java.util.List;
32
33 import org.nuiton.math.matrix.MatrixFactory;
34 import org.nuiton.math.matrix.MatrixND;
35 import org.junit.Assert;
36 import org.junit.Test;
37
38
39
40
41
42
43
44
45
46
47 public class MonthTest {
48
49
50
51
52 @Test
53 public void listTest() {
54
55 List<Month> monthList = new LinkedList<Month>();
56 monthList.add(new Month(0));
57 monthList.add(new Month(1));
58 monthList.add(new Month(2));
59
60 Assert.assertTrue(monthList.contains(Month.JANUARY));
61 Assert.assertFalse(monthList.contains(Month.AUGUST));
62
63 Assert.assertEquals(0, monthList.indexOf(Month.JANUARY));
64 Assert.assertEquals(-1, monthList.indexOf(Month.AUGUST));
65 }
66
67 @Test
68 public void maxtrixWithMonth() {
69
70 List<Month> monthList = new LinkedList<Month>();
71 monthList.add(new Month(0));
72 monthList.add(new Month(1));
73 monthList.add(new Month(2));
74
75 List<Month> monthList2 = new LinkedList<Month>();
76 monthList2.add(Month.FEBRUARY);
77
78 MatrixND tmp = MatrixFactory.getInstance().create(
79 "test",
80 new List[] { monthList },
81 new String[] { t("isisfish.populationSeasonInfo.months") });
82
83 MatrixND result = MatrixFactory.getInstance().create(
84 "test",
85 new List[] { monthList2 },
86 new String[] { t("isisfish.populationSeasonInfo.months") });
87
88 tmp.pasteSemantics(result);
89 }
90 }