EmptyStep test

This commit is contained in:
uogau 2021-02-08 13:40:09 +01:00
parent f46997d359
commit 612edac87b

View File

@ -0,0 +1,40 @@
package edu.kit.typicalc.model.step;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class EmptyStepTest {
@Test
void getConclusionTest() {
EmptyStep step = new EmptyStep();
boolean thrown = false;
try {
step.getConclusion();
} catch (IllegalStateException e) {
thrown = true;
}
assertTrue(thrown);
}
@Test
void getConstraintTest() {
EmptyStep step = new EmptyStep();
boolean thrown = false;
try {
step.getConstraint();
} catch (IllegalStateException e) {
thrown = true;
}
assertTrue(thrown);
}
@Test
void acceptTest() {
TestStepVisitor testStepVisitor = new TestStepVisitor();
EmptyStep step = new EmptyStep();
step.accept(testStepVisitor);
assertEquals("empty", testStepVisitor.visited);
}
}