1
0
Fork 0

JUnit-Tests hinzugefügt

main
Florian Hörner 2024-01-08 19:13:20 +01:00
parent de40e65e21
commit 3416b6dd75
1 changed files with 55 additions and 0 deletions

View File

@ -0,0 +1,55 @@
package de.hs_mannheim.informatik.spreadsheet;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class SpreadsheetTest {
@Test
void sum() {
}
@Test
void pro() {
}
@Test
void min() {
}
@Test
void max() {
}
@Test
void mittelwert() {
}
@Test
void calculate() {
Spreadsheet spr = new Spreadsheet(20,20);
assertEquals(spr.calculate("20+2"), 22);
assertEquals(spr.calculate("4-3"), 1);
assertEquals(spr.calculate("3*3"), 9);
assertEquals(spr.calculate("9/3"), 3);
spr.put("A1", "3");
spr.put("A2", "3");
assertEquals(spr.calculate("A1+20"), 23);
assertEquals(spr.calculate("A1+A2"), 6);
assertEquals(spr.calculate("A1-A2"), 0);
assertEquals(spr.calculate("A1*A2"), 9);
assertEquals(spr.calculate("A1/A2"), 1);
}
@Test
void rechne() {
// 1 = +, 2 = -, 3 = *, 4 = /
//assertEquals(Spreadsheet.rechne(), );
}
}