2022-04-03 21:16:05 +02:00
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
|
|
|
|
import static org.junit.jupiter.api.Assertions.*;
|
|
|
|
|
|
|
|
class Aufgabe1_KellerautomatTest {
|
|
|
|
|
|
|
|
@Test
|
|
|
|
void calculate() {
|
2022-04-06 23:54:20 +02:00
|
|
|
String[] acceptableWords = {"ZZ+", "ZZ*ZZ+*", "ZZZ*+"};
|
2022-04-03 21:16:05 +02:00
|
|
|
for (String word : acceptableWords) {
|
|
|
|
assertTrue(Aufgabe1_Kellerautomat.calculate(word));
|
|
|
|
}
|
|
|
|
|
2022-04-06 23:54:20 +02:00
|
|
|
String[] notAcceptableWords = {"ZZ*+", "ZZ+ZZ*", "Z*Z"};
|
2022-04-03 21:16:05 +02:00
|
|
|
for (String word : notAcceptableWords) {
|
|
|
|
assertFalse(Aufgabe1_Kellerautomat.calculate(word));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|