19 lines
537 B
Java
19 lines
537 B
Java
import org.junit.jupiter.api.Test;
|
|
|
|
import static org.junit.jupiter.api.Assertions.*;
|
|
|
|
class Aufgabe1_KellerautomatTest {
|
|
|
|
@Test
|
|
void calculate() {
|
|
String[] acceptableWords = {"ZZ+", "ZZ*ZZ+*", "ZZZ*+"};
|
|
for (String word : acceptableWords) {
|
|
assertTrue(Aufgabe1_Kellerautomat.calculate(word));
|
|
}
|
|
|
|
String[] notAcceptableWords = {"ZZ*+", "ZZ+ZZ*", "Z*Z"};
|
|
for (String word : notAcceptableWords) {
|
|
assertFalse(Aufgabe1_Kellerautomat.calculate(word));
|
|
}
|
|
}
|
|
} |