From 0c4a46ca8174824fc029d3cf38715d170b27c3ff Mon Sep 17 00:00:00 2001 From: mandjemb Date: Tue, 11 Jun 2019 18:55:39 +0200 Subject: [PATCH] test --- src/kernel/test/BinaryOperationTest.java | 3 ++- src/kernel/test/FunctionTest.java | 4 ++-- src/kernel/test/GridTest.java | 23 ++++++++++++----------- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/kernel/test/BinaryOperationTest.java b/src/kernel/test/BinaryOperationTest.java index 2223b52..b45bc10 100644 --- a/src/kernel/test/BinaryOperationTest.java +++ b/src/kernel/test/BinaryOperationTest.java @@ -4,6 +4,7 @@ import kernel.Cell; import kernel.Grid; import kernel.LanguageEnum; import kernel.exception.CreateCycleException; +import kernel.exception.InvalidIntervalLineColumnEception; import kernel.function.Sum; import kernel.operation.Addition; import kernel.operation.Division; @@ -22,7 +23,7 @@ public class BinaryOperationTest { private List cells; @Before - public void initData() throws CreateCycleException { + public void initData() throws CreateCycleException, InvalidIntervalLineColumnEception { Grid.language = LanguageEnum.EN; this.cells = new ArrayList<>(); diff --git a/src/kernel/test/FunctionTest.java b/src/kernel/test/FunctionTest.java index f0338fe..b6bc7c3 100644 --- a/src/kernel/test/FunctionTest.java +++ b/src/kernel/test/FunctionTest.java @@ -3,6 +3,7 @@ package kernel.test; import kernel.Cell; import kernel.Grid; import kernel.LanguageEnum; +import kernel.exception.InvalidIntervalLineColumnEception; import kernel.function.Sum; import org.junit.Before; import org.junit.Test; @@ -10,14 +11,13 @@ import org.junit.Test; import java.util.ArrayList; import java.util.List; -import static org.junit.Assert.*; public class FunctionTest { private List cells; @Before - public void initData() { + public void initData() throws InvalidIntervalLineColumnEception { Grid.language = LanguageEnum.EN; this.cells = new ArrayList<>(); diff --git a/src/kernel/test/GridTest.java b/src/kernel/test/GridTest.java index 61158d6..df33901 100644 --- a/src/kernel/test/GridTest.java +++ b/src/kernel/test/GridTest.java @@ -5,6 +5,7 @@ import kernel.Grid; import kernel.LanguageEnum; import kernel.exception.CellNotFoundException; import kernel.exception.CreateCycleException; +import kernel.exception.InvalidIntervalLineColumnEception; import kernel.function.Average; import kernel.function.Sum; import kernel.operation.Addition; @@ -29,7 +30,7 @@ public class GridTest { } @Test - public void testCreateCellWithValue() { + public void testCreateCellWithValue() throws InvalidIntervalLineColumnEception { assertEquals(0, this.grid.getCells().size()); this.grid.createCell("A", 1, 10.); @@ -38,7 +39,7 @@ public class GridTest { } @Test - public void testCreateCellWithFormula() throws CellNotFoundException, CreateCycleException { + public void testCreateCellWithFormula() throws CellNotFoundException, CreateCycleException, InvalidIntervalLineColumnEception { this.createCellsWithValue(); assertEquals(3, this.grid.getCells().size()); @@ -52,7 +53,7 @@ public class GridTest { } @Test - public void testGetValue() throws CellNotFoundException, CreateCycleException { + public void testGetValue() throws CellNotFoundException, CreateCycleException, InvalidIntervalLineColumnEception { this.createCellsWithFormula(); assertEquals(10, this.grid.getValue("A", 1), 0); @@ -64,7 +65,7 @@ public class GridTest { } @Test - public void testGetFormulaAsString() throws CellNotFoundException, CreateCycleException { + public void testGetFormulaAsString() throws CellNotFoundException, CreateCycleException, InvalidIntervalLineColumnEception { Grid.language = LanguageEnum.EN; this.createCellsWithFormula(); @@ -77,14 +78,14 @@ public class GridTest { } @Test - public void testGetDevelopedFormula() throws CellNotFoundException, CreateCycleException { + public void testGetDevelopedFormula() throws CellNotFoundException, CreateCycleException, InvalidIntervalLineColumnEception { this.createCellsWithFormula(); assertEquals("A3*SUM(A1,A2,A3)", this.grid.getDevelopedFormula("B", 3)); } @Test - public void testSetValue() throws CellNotFoundException, CreateCycleException { + public void testSetValue() throws CellNotFoundException, CreateCycleException, InvalidIntervalLineColumnEception { this.createCellsWithFormula(); assertEquals(10, this.grid.getValue("A", 1), 0); @@ -105,7 +106,7 @@ public class GridTest { } @Test - public void testSetFormula() throws CellNotFoundException, CreateCycleException { + public void testSetFormula() throws CellNotFoundException, CreateCycleException, InvalidIntervalLineColumnEception { this.createCellsWithFormula(); assertEquals(12, this.grid.getValue("B", 2), 0); @@ -152,7 +153,7 @@ public class GridTest { } @Test - public void testGetCell() throws CellNotFoundException { + public void testGetCell() throws CellNotFoundException, InvalidIntervalLineColumnEception { this.createCellsWithValue(); Cell cell = this.grid.getCell("A", 1); @@ -168,7 +169,7 @@ public class GridTest { } @Test - public void testGetCells() { + public void testGetCells() throws InvalidIntervalLineColumnEception { assertEquals(0, this.grid.getCells().size()); this.createCellsWithValue(); @@ -176,13 +177,13 @@ public class GridTest { assertEquals(3, this.grid.getCells().size()); } - private void createCellsWithValue() { + private void createCellsWithValue() throws InvalidIntervalLineColumnEception { this.grid.createCell("A", 1, 10.); this.grid.createCell("A", 2, 0.); this.grid.createCell("A", 3, 2.); } - private void createCellsWithFormula() throws CellNotFoundException, CreateCycleException { + private void createCellsWithFormula() throws CellNotFoundException, CreateCycleException, InvalidIntervalLineColumnEception { this.createCellsWithValue(); Cell a1 = this.grid.getCell("A", 1); -- libgit2 0.21.2