27 lines
943 B
Java
27 lines
943 B
Java
package be.seeseemelk.llamascript;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
import org.junit.jupiter.params.ParameterizedTest;
|
|
import org.junit.jupiter.params.provider.ValueSource;
|
|
|
|
import static org.hamcrest.MatcherAssert.assertThat;
|
|
import static org.hamcrest.Matchers.equalTo;
|
|
|
|
public class BooleanTests extends AbstractLlamaTest {
|
|
@ParameterizedTest
|
|
@ValueSource(ints = {0, 1, 2, 3, 4, 5})
|
|
void isEven(int number) {
|
|
boolean isEven = llama.evalBool("Return true if the number is even", number);
|
|
assertThat(isEven, equalTo(number % 2 == 0));
|
|
}
|
|
|
|
@Test
|
|
void isABuilding() {
|
|
boolean isBuilding = llama.evalBool("Return true if the argument is a building or skyscraper", "Dalai Lama");
|
|
assertThat(isBuilding, equalTo(false));
|
|
|
|
isBuilding = llama.evalBool("Return true if the argument is a building or skyscraper", "Burj Khalifa");
|
|
assertThat(isBuilding, equalTo(true));
|
|
}
|
|
}
|