package de.hs_mannheim.informatik.spreadsheet; import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.Arrays; import java.util.regex.Matcher; import java.util.regex.Pattern; import static org.junit.jupiter.api.Assertions.*; class SpreadsheetTest { String[][] cells = {{"1","2"},{"2","4"},{"3","6"}}; @Test void sumTest() { double result = 0; for(int r = 0; r0) result *= Double.parseDouble(cells[r][c]); else { result = Double.parseDouble(cells[r][c]); counter++; } assertEquals(288,result); } @Test void averageTest() { double result = 0; int counter = 0; for(int r = 0; r cellNames = new ArrayList<>(); double result = 0; double avg = 0; int counter = 0; for(int r = 0; r copyCellNames = new ArrayList<>(cellNames); double[] frequency = new double[cellNames.size()]; Arrays.fill(frequency,1); ArrayList relativeFrequency = new ArrayList<>(); double mem = 0; for(int i = 0; i< cellNames.size(); i++) { for(int t = 0; t cellNames = new ArrayList<>(); for(int r = 0; r< cells.length; r++) for(int c = 0; c Double.parseDouble(cellNames.get(i))) result = Double.parseDouble(cellNames.get(i)); assertEquals(1,result); } @Test void maxTest() { ArrayList cellNames = new ArrayList<>(); for(int r = 0; r< cells.length; r++) for(int c = 0; c