|
|
@ -1,6 +1,7 @@ |
|
|
|
package org.bitbiome.commands; |
|
|
|
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertEquals; |
|
|
|
import static org.junit.jupiter.api.Assertions.assertTrue; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
@ -35,6 +36,15 @@ public class UseCommandTest { |
|
|
|
assertEquals(100, com.getRunawayChance()); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testRunawaySucceeds() { |
|
|
|
UseCommand com = new UseCommand(); |
|
|
|
assertEquals(true, com.runawaySucceeds(0)); |
|
|
|
assertEquals(false, com.runawaySucceeds(101)); |
|
|
|
int random = (int)(Math.random()*100); |
|
|
|
assertTrue(com.runawaySucceeds(random) || !com.runawaySucceeds(random)); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testUseItemMob() { |
|
|
|
UseCommand com = new UseCommand(); |
|
|
|