Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DRSchlaubi committed May 26, 2021
1 parent 62285c6 commit 2890e8c
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions common/src/test/kotlin/json/InteractionTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,16 @@ class InteractionTest {

val interaction = json.decodeFromString(DiscordInteraction.serializer(), text)
with(interaction) {
val commandData = data as DiscordApplicationCommandInteractionData
channelId shouldBe "587324906702766226"
applicationId shouldBe "297153970613387264"
id shouldBe "793442788670832640"
version shouldBe 1
type.type shouldBe 2
token shouldBe "hunter2"
data.name shouldBe "testsubcommands"
data.id shouldBe "792107855418490901"
val group = data.options.orEmpty().first()
commandData.name shouldBe "testsubcommands"
commandData.id shouldBe "792107855418490901"
val group = commandData.options.orEmpty().first()
assert(group is CommandGroup)
group as CommandGroup
group.name shouldBe "group"
Expand All @@ -56,15 +57,16 @@ class InteractionTest {

val interaction = json.decodeFromString(DiscordInteraction.serializer(), text)
with(interaction) {
val commandData = data as DiscordApplicationCommandInteractionData
channelId shouldBe "587324906702766226"
applicationId shouldBe "297153970613387264"
id shouldBe "793442788670832640"
version shouldBe 1
type.type shouldBe 2
token shouldBe "hunter2"
data.name shouldBe "testsubcommands"
data.id shouldBe "792107855418490901"
val subCommand = data.options.orEmpty().first()
commandData.name shouldBe "testsubcommands"
commandData.id shouldBe "792107855418490901"
val subCommand = commandData.options.orEmpty().first()
assert(subCommand is SubCommand)
subCommand as SubCommand
subCommand.name shouldBe "subcommand"
Expand All @@ -82,15 +84,16 @@ class InteractionTest {

val interaction = json.decodeFromString(DiscordInteraction.serializer(), text)
with(interaction) {
val commandData = data as DiscordApplicationCommandInteractionData
channelId shouldBe "587324906702766226"
applicationId shouldBe "297153970613387264"
id shouldBe "793442788670832640"
version shouldBe 1
type.type shouldBe 2
token shouldBe "hunter2"
data.name shouldBe "testsubcommands"
data.id shouldBe "792107855418490901"
val arg = data.options.orEmpty().first()
commandData.name shouldBe "testsubcommands"
commandData.id shouldBe "792107855418490901"
val arg = commandData.options.orEmpty().first()
assert(arg is CommandArgument<*>)
arg as CommandArgument<*>
arg.name shouldBe "testint"
Expand Down

0 comments on commit 2890e8c

Please sign in to comment.