Browse Source

unittest: ShopCommandTest.java

remotes/origin/shop
Max Gerbeth 2 years ago
parent
commit
148b7f0927
  1. 2
      src/main/java/org/bitbiome/commands/ShopCommand.java
  2. 16
      src/test/java/org/bitbiome/commands/ShopCommandTest.java

2
src/main/java/org/bitbiome/commands/ShopCommand.java

@ -35,7 +35,7 @@ public class ShopCommand implements CommandAPI{
} }
} }
private boolean validInput(String input){
public static boolean validInput(String input){
return (input.equals("1") || input.equals("2") || input.equals("3")); return (input.equals("1") || input.equals("2") || input.equals("3"));
} }

16
src/test/java/org/bitbiome/commands/ShopCommandTest.java

@ -0,0 +1,16 @@
package org.bitbiome.commands;
import org.bitbiome.shop.Shop;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class ShopCommandTest {
final ShopCommand shopCommand = new ShopCommand();
@Test
public void testValidInput(){
boolean expected = true;
boolean result = shopCommand.validInput("1");
assertEquals(expected, result);
}
}
Loading…
Cancel
Save