From 445190db8961cf866b81bfc0daeaaff190f5e8d7 Mon Sep 17 00:00:00 2001 From: tueem Date: Mon, 16 Dec 2024 12:49:51 +0100 Subject: [PATCH] added Tests for choices --- .../marinara/test/TestChoiceEnum.java | 20 +++++++++++++++++++ .../tomatentum/marinara/test/TestCommand.java | 3 ++- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 wrapper/javacord/src/test/java/net/tomatentum/marinara/test/TestChoiceEnum.java diff --git a/wrapper/javacord/src/test/java/net/tomatentum/marinara/test/TestChoiceEnum.java b/wrapper/javacord/src/test/java/net/tomatentum/marinara/test/TestChoiceEnum.java new file mode 100644 index 0000000..1c7fd0a --- /dev/null +++ b/wrapper/javacord/src/test/java/net/tomatentum/marinara/test/TestChoiceEnum.java @@ -0,0 +1,20 @@ +package net.tomatentum.marinara.test; + +import net.tomatentum.marinara.interaction.commands.ChoiceValueProvider; + +public enum TestChoiceEnum implements ChoiceValueProvider { + TestValue("testValue"), + FooBar("fooBar"), + Spongebob("spongebob"); + + private String value; + + private TestChoiceEnum(String value) { + this.value = value; + } + @Override + public String getChoiceValue() { + return value; + } + +} diff --git a/wrapper/javacord/src/test/java/net/tomatentum/marinara/test/TestCommand.java b/wrapper/javacord/src/test/java/net/tomatentum/marinara/test/TestCommand.java index f6710b0..2716fea 100644 --- a/wrapper/javacord/src/test/java/net/tomatentum/marinara/test/TestCommand.java +++ b/wrapper/javacord/src/test/java/net/tomatentum/marinara/test/TestCommand.java @@ -20,7 +20,8 @@ public class TestCommand implements InteractionHandler { @SlashCommandOption( name = "foo", description = "foo bar is very fooby", - type = SlashCommandOptionType.STRING + type = SlashCommandOptionType.STRING, + choiceEnum = TestChoiceEnum.class ) } )