diff --git a/src/main/java/org/bitbiome/commands/ShopCommand.java b/src/main/java/org/bitbiome/commands/ShopCommand.java index 3cc6337..1231a48 100644 --- a/src/main/java/org/bitbiome/commands/ShopCommand.java +++ b/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")); } diff --git a/src/test/java/org/bitbiome/commands/ShopCommandTest.java b/src/test/java/org/bitbiome/commands/ShopCommandTest.java new file mode 100644 index 0000000..449fc23 --- /dev/null +++ b/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); + } +}