Commit c3cd26f8 authored by Bruno Mario Gundlach's avatar Bruno Mario Gundlach

testcases for random number

parent fe41b3bc
This diff is collapsed.
......@@ -7,5 +7,17 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library name="JUnit5.2">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-api/5.3.1/junit-jupiter-api-5.3.1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/apiguardian/apiguardian-api/1.0.0/apiguardian-api-1.0.0.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/opentest4j/opentest4j/1.1.1/opentest4j-1.1.1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-commons/1.3.1/junit-platform-commons-1.3.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component>
</module>
\ No newline at end of file
......@@ -52,7 +52,7 @@ public class Gesture {
}
//This method generate a random number between 1 and 3
private int getrandomNumberbetweenOneandThree() {
protected int getrandomNumberbetweenOneandThree() {
int randomnum;
randomnum = (int) (Math.random() * 3 + 1);
return randomnum;
......
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.Test;
public class TestGesture extends Gesture{
@Test
public void TestgetrandomNumberbetweenOneandThree() {
Gesture testGest = new Gesture();
assertTrue(testGest.getrandomNumberbetweenOneandThree() < 4, "The number ist less than 4");
assertTrue(testGest.getrandomNumberbetweenOneandThree() > 0, "The number ist greater than 0");
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment