Commit 0c4a46ca8174824fc029d3cf38715d170b27c3ff
1 parent
e0bdcd83
test
Showing
3 changed files
with
16 additions
and
14 deletions
Show diff stats
src/kernel/test/BinaryOperationTest.java
... | ... | @@ -4,6 +4,7 @@ import kernel.Cell; |
4 | 4 | import kernel.Grid; |
5 | 5 | import kernel.LanguageEnum; |
6 | 6 | import kernel.exception.CreateCycleException; |
7 | +import kernel.exception.InvalidIntervalLineColumnEception; | |
7 | 8 | import kernel.function.Sum; |
8 | 9 | import kernel.operation.Addition; |
9 | 10 | import kernel.operation.Division; |
... | ... | @@ -22,7 +23,7 @@ public class BinaryOperationTest { |
22 | 23 | private List<Cell> cells; |
23 | 24 | |
24 | 25 | @Before |
25 | - public void initData() throws CreateCycleException { | |
26 | + public void initData() throws CreateCycleException, InvalidIntervalLineColumnEception { | |
26 | 27 | Grid.language = LanguageEnum.EN; |
27 | 28 | this.cells = new ArrayList<>(); |
28 | 29 | ... | ... |
src/kernel/test/FunctionTest.java
... | ... | @@ -3,6 +3,7 @@ package kernel.test; |
3 | 3 | import kernel.Cell; |
4 | 4 | import kernel.Grid; |
5 | 5 | import kernel.LanguageEnum; |
6 | +import kernel.exception.InvalidIntervalLineColumnEception; | |
6 | 7 | import kernel.function.Sum; |
7 | 8 | import org.junit.Before; |
8 | 9 | import org.junit.Test; |
... | ... | @@ -10,14 +11,13 @@ import org.junit.Test; |
10 | 11 | import java.util.ArrayList; |
11 | 12 | import java.util.List; |
12 | 13 | |
13 | -import static org.junit.Assert.*; | |
14 | 14 | |
15 | 15 | public class FunctionTest { |
16 | 16 | |
17 | 17 | private List<Cell> cells; |
18 | 18 | |
19 | 19 | @Before |
20 | - public void initData() { | |
20 | + public void initData() throws InvalidIntervalLineColumnEception { | |
21 | 21 | Grid.language = LanguageEnum.EN; |
22 | 22 | this.cells = new ArrayList<>(); |
23 | 23 | ... | ... |
src/kernel/test/GridTest.java
... | ... | @@ -5,6 +5,7 @@ import kernel.Grid; |
5 | 5 | import kernel.LanguageEnum; |
6 | 6 | import kernel.exception.CellNotFoundException; |
7 | 7 | import kernel.exception.CreateCycleException; |
8 | +import kernel.exception.InvalidIntervalLineColumnEception; | |
8 | 9 | import kernel.function.Average; |
9 | 10 | import kernel.function.Sum; |
10 | 11 | import kernel.operation.Addition; |
... | ... | @@ -29,7 +30,7 @@ public class GridTest { |
29 | 30 | } |
30 | 31 | |
31 | 32 | @Test |
32 | - public void testCreateCellWithValue() { | |
33 | + public void testCreateCellWithValue() throws InvalidIntervalLineColumnEception { | |
33 | 34 | assertEquals(0, this.grid.getCells().size()); |
34 | 35 | |
35 | 36 | this.grid.createCell("A", 1, 10.); |
... | ... | @@ -38,7 +39,7 @@ public class GridTest { |
38 | 39 | } |
39 | 40 | |
40 | 41 | @Test |
41 | - public void testCreateCellWithFormula() throws CellNotFoundException, CreateCycleException { | |
42 | + public void testCreateCellWithFormula() throws CellNotFoundException, CreateCycleException, InvalidIntervalLineColumnEception { | |
42 | 43 | this.createCellsWithValue(); |
43 | 44 | assertEquals(3, this.grid.getCells().size()); |
44 | 45 | |
... | ... | @@ -52,7 +53,7 @@ public class GridTest { |
52 | 53 | } |
53 | 54 | |
54 | 55 | @Test |
55 | - public void testGetValue() throws CellNotFoundException, CreateCycleException { | |
56 | + public void testGetValue() throws CellNotFoundException, CreateCycleException, InvalidIntervalLineColumnEception { | |
56 | 57 | this.createCellsWithFormula(); |
57 | 58 | |
58 | 59 | assertEquals(10, this.grid.getValue("A", 1), 0); |
... | ... | @@ -64,7 +65,7 @@ public class GridTest { |
64 | 65 | } |
65 | 66 | |
66 | 67 | @Test |
67 | - public void testGetFormulaAsString() throws CellNotFoundException, CreateCycleException { | |
68 | + public void testGetFormulaAsString() throws CellNotFoundException, CreateCycleException, InvalidIntervalLineColumnEception { | |
68 | 69 | Grid.language = LanguageEnum.EN; |
69 | 70 | this.createCellsWithFormula(); |
70 | 71 | |
... | ... | @@ -77,14 +78,14 @@ public class GridTest { |
77 | 78 | } |
78 | 79 | |
79 | 80 | @Test |
80 | - public void testGetDevelopedFormula() throws CellNotFoundException, CreateCycleException { | |
81 | + public void testGetDevelopedFormula() throws CellNotFoundException, CreateCycleException, InvalidIntervalLineColumnEception { | |
81 | 82 | this.createCellsWithFormula(); |
82 | 83 | |
83 | 84 | assertEquals("A3*SUM(A1,A2,A3)", this.grid.getDevelopedFormula("B", 3)); |
84 | 85 | } |
85 | 86 | |
86 | 87 | @Test |
87 | - public void testSetValue() throws CellNotFoundException, CreateCycleException { | |
88 | + public void testSetValue() throws CellNotFoundException, CreateCycleException, InvalidIntervalLineColumnEception { | |
88 | 89 | this.createCellsWithFormula(); |
89 | 90 | |
90 | 91 | assertEquals(10, this.grid.getValue("A", 1), 0); |
... | ... | @@ -105,7 +106,7 @@ public class GridTest { |
105 | 106 | } |
106 | 107 | |
107 | 108 | @Test |
108 | - public void testSetFormula() throws CellNotFoundException, CreateCycleException { | |
109 | + public void testSetFormula() throws CellNotFoundException, CreateCycleException, InvalidIntervalLineColumnEception { | |
109 | 110 | this.createCellsWithFormula(); |
110 | 111 | |
111 | 112 | assertEquals(12, this.grid.getValue("B", 2), 0); |
... | ... | @@ -152,7 +153,7 @@ public class GridTest { |
152 | 153 | } |
153 | 154 | |
154 | 155 | @Test |
155 | - public void testGetCell() throws CellNotFoundException { | |
156 | + public void testGetCell() throws CellNotFoundException, InvalidIntervalLineColumnEception { | |
156 | 157 | this.createCellsWithValue(); |
157 | 158 | |
158 | 159 | Cell cell = this.grid.getCell("A", 1); |
... | ... | @@ -168,7 +169,7 @@ public class GridTest { |
168 | 169 | } |
169 | 170 | |
170 | 171 | @Test |
171 | - public void testGetCells() { | |
172 | + public void testGetCells() throws InvalidIntervalLineColumnEception { | |
172 | 173 | assertEquals(0, this.grid.getCells().size()); |
173 | 174 | |
174 | 175 | this.createCellsWithValue(); |
... | ... | @@ -176,13 +177,13 @@ public class GridTest { |
176 | 177 | assertEquals(3, this.grid.getCells().size()); |
177 | 178 | } |
178 | 179 | |
179 | - private void createCellsWithValue() { | |
180 | + private void createCellsWithValue() throws InvalidIntervalLineColumnEception { | |
180 | 181 | this.grid.createCell("A", 1, 10.); |
181 | 182 | this.grid.createCell("A", 2, 0.); |
182 | 183 | this.grid.createCell("A", 3, 2.); |
183 | 184 | } |
184 | 185 | |
185 | - private void createCellsWithFormula() throws CellNotFoundException, CreateCycleException { | |
186 | + private void createCellsWithFormula() throws CellNotFoundException, CreateCycleException, InvalidIntervalLineColumnEception { | |
186 | 187 | this.createCellsWithValue(); |
187 | 188 | |
188 | 189 | Cell a1 = this.grid.getCell("A", 1); | ... | ... |