From c948b558028761cb32d9d3b48a2b05edd4a4bef5 Mon Sep 17 00:00:00 2001 From: Branson778 Date: Sun, 3 Sep 2023 16:27:17 -0700 Subject: [PATCH 1/2] Start working on new tests for FeatureTwoTest.java --- build.gradle | 2 +- .../jointheleague/discord_bot/DiscordBot.java | 6 +- .../student/second_feature/FeatureTwo.java | 104 ++++++++++++++ .../first_features/CurrentTimeTest.java | 2 +- .../first_features/RandomNumberTest.java | 2 +- .../second_features/HighLowGameTest.java | 2 +- .../third_features/CatFactsApiTest.java | 2 +- .../examples/third_features/NewsApiTest.java | 2 +- .../second_feature/FeatureTwoTest.java | 131 ++++++++++++++++++ .../templates/FeatureTemplateTest.java | 2 +- 10 files changed, 246 insertions(+), 9 deletions(-) create mode 100644 src/main/java/org/jointheleague/features/student/second_feature/FeatureTwo.java create mode 100644 src/test/java/org/jointheleague/features/student/second_feature/FeatureTwoTest.java diff --git a/build.gradle b/build.gradle index bee38ebc..bb3a859e 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ repositories { } dependencies { - implementation 'org.javacord:javacord:3.1.1' + implementation 'org.javacord:javacord:3.8.0' implementation 'net.aksingh:owm-japis:2.5.3.0' implementation 'com.googlecode.json-simple:json-simple:1.1.1' implementation 'javax.json:javax.json-api:1.1' diff --git a/src/main/java/org/jointheleague/discord_bot/DiscordBot.java b/src/main/java/org/jointheleague/discord_bot/DiscordBot.java index fa40f61f..61690f03 100644 --- a/src/main/java/org/jointheleague/discord_bot/DiscordBot.java +++ b/src/main/java/org/jointheleague/discord_bot/DiscordBot.java @@ -2,6 +2,7 @@ import org.javacord.api.DiscordApi; import org.javacord.api.DiscordApiBuilder; +import org.javacord.api.entity.intent.Intent; import org.jointheleague.features.abstract_classes.Feature; import org.jointheleague.features.examples.second_features.HighLowGame; import org.jointheleague.features.examples.third_features.CatFactsApi; @@ -9,6 +10,7 @@ import org.jointheleague.features.examples.first_features.CurrentTime; import org.jointheleague.features.examples.first_features.RandomNumber; import org.jointheleague.features.help_embed.HelpListener; +import org.jointheleague.features.student.second_feature.FeatureTwo; public class DiscordBot { @@ -28,7 +30,7 @@ public DiscordBot(String token, String channelName) { public void connect(boolean printInvite) { - api = new DiscordApiBuilder().setToken(token).login().join(); + api = new DiscordApiBuilder().setToken(token).addIntents(Intent.MESSAGE_CONTENT).login().join(); //Print the URL to invite the bot if (printInvite) { @@ -45,7 +47,7 @@ public void connect(boolean printInvite) { //add features addFeature(new RandomNumber(channelName)); addFeature(new CurrentTime(channelName)); - addFeature(new HighLowGame(channelName)); + addFeature(new FeatureTwo(channelName)); addFeature(new NewsApi(channelName)); addFeature(new CatFactsApi(channelName)); } diff --git a/src/main/java/org/jointheleague/features/student/second_feature/FeatureTwo.java b/src/main/java/org/jointheleague/features/student/second_feature/FeatureTwo.java new file mode 100644 index 00000000..005101d7 --- /dev/null +++ b/src/main/java/org/jointheleague/features/student/second_feature/FeatureTwo.java @@ -0,0 +1,104 @@ +package org.jointheleague.features.student.second_feature; + +import org.javacord.api.event.message.MessageCreateEvent; +import org.jointheleague.features.abstract_classes.Feature; +import org.jointheleague.features.help_embed.plain_old_java_objects.help_embed.HelpEmbed; +import org.jointheleague.features.templates.FeatureTemplate; + +public class FeatureTwo extends FeatureTemplate { + public final String COMMAND = "!popquiz"; + int questionNumber = 0; + int points = 0; + + public FeatureTwo(String channelName) { + super(channelName); + + //Create a help embed to describe feature when !help command is sent + helpEmbed = new HelpEmbed( + COMMAND, + "This command will give you a short quiz about science and science related facts. Remember to answer the question type "+ COMMAND+" and then a space following that and finally your answer from the list." + ); + } + + @Override + public void handle(MessageCreateEvent event) { + String messageContent = event.getMessageContent(); + + if (messageContent.equals(COMMAND)) { + //respond to message here + points = 0; + questionNumber = 1; + event.getChannel().sendMessage("First question: What is it called when a liquid's temperature is lowered until it is below its freezing point yet it is still a liquid? \nA: Ice Nucleation \nB: Supercooling \nC: Antifreezing \nD: Impossible" + ); + } + else if(messageContent.contains(COMMAND) && questionNumber == 0){ + event.getChannel().sendMessage("Please be sure to start the game before adding any answer prompt. Start the game by typing !\u200Epopquiz."); + } + else if (messageContent.contains(COMMAND) && questionNumber == 1){ + if(messageContent.equalsIgnoreCase(COMMAND+" Supercooling") || messageContent.equalsIgnoreCase(COMMAND+" B")){ + points++; + event.getChannel().sendMessage("Correct! Adding one point to your score. Alright onto the next question!"); + questionNumber++; + event.getChannel().sendMessage("Question two: What is the most radioactive substance ever discovered? \n A: Uranium \n B: Plutonium \n C: Radium \n D: Polonium \n E: Nobelium \n F: Lawrencium \n G: Oganesson \n H: Krypton \n I: Promethium \n J: Iridium" ); + } + else{ + event.getChannel().sendMessage("Ooh, so close. Sadly we cannot give points for incorrect answers. Alright onto the next question!"); + questionNumber++; + event.getChannel().sendMessage("Question two: What is the most radioactive substance ever discovered? \n A: Uranium \n B: Plutonium \n C: Radium \n D: Polonium \n E: Nobelium \n F: Lawrencium \n G: Oganesson \n H: Krypton \n I: Promethium \n J: Iridium" ); + } + } + else if (messageContent.contains(COMMAND) && questionNumber ==2){ + if(messageContent.equalsIgnoreCase(COMMAND + " Oganesson") || messageContent.equalsIgnoreCase(COMMAND + " G")){ + points++; + event.getChannel().sendMessage("Correct! Adding one point to your score. Alright onto the next question!"); + questionNumber++; + event.getChannel().sendMessage("Question three: Can any element in any state be magnetic? \nA: Yes, all elements can be magnetic and it can occur naturally in each. \nB: Yes, (almost) all elements can be magnetic with electromagnetism. \nC: No, not all elements can be magnetic under any circumstances."); + } + else{ + event.getChannel().sendMessage("Ooh, so close. Sadly we cannot give points for incorrect answers. Alright onto the next question!"); + questionNumber++; + event.getChannel().sendMessage("Question three: Can any element in any state be magnetic? \nA: Yes, all elements can be magnetic and it can occur naturally in each. \nB: Yes, (almost) all elements can be magnetic with electromagnetism. \nC: No, not all elements can be magnetic under any circumstances."); + } + } + else if (messageContent.contains(COMMAND) && questionNumber ==3){ + if(messageContent.equalsIgnoreCase(COMMAND + " Yes, (almost) all elements can be magnetic with electromagnetism.") || messageContent.equalsIgnoreCase(COMMAND + " B")){ + points++; + event.getChannel().sendMessage("Correct! Adding one point to your score. Alright onto the next question!"); + questionNumber++; + event.getChannel().sendMessage("Question four: What is chalk made out of? \nA: Nothing,chalk is chalk \nB: Limestone, which is made up of Calcite \nC: Calcium Carbonate \nD: Calcium Citrate"); + } + else{ + event.getChannel().sendMessage("Ooh, so close. Sadly we cannot give points for incorrect answers. Alright onto the next question!"); + questionNumber++; + event.getChannel().sendMessage("Question four: What is chalk made out of? \nA: Nothing,chalk is chalk \nB: Limestone, which is made up of Calcite \nC: Calcium Carbonate \nD: Calcium Citrate"); + } + } + else if (messageContent.contains(COMMAND) && questionNumber ==4) { + if (messageContent.equalsIgnoreCase(COMMAND + " Limestone, which is made up of Calcite") || messageContent.equalsIgnoreCase(COMMAND + " B")) { + points++; + event.getChannel().sendMessage("Correct! Adding one point to your score. Alright onto the next question!"); + questionNumber++; + event.getChannel().sendMessage("What is the only tree to grow in saltwater? \nA: Mangrove \nB: Banyan \nC: Bald cypress \nD: Water tupelo"); + } + else { + event.getChannel().sendMessage("Ooh, so close. Sadly we cannot give points for incorrect answers. Alright onto the next question!"); + questionNumber++; + event.getChannel().sendMessage("What is the only tree to grow in saltwater? \nA: Mangrove \nB: Banyan \nC: Bald cypress \nD: Water tupelo"); + } + } + else if (messageContent.contains(COMMAND) && questionNumber ==5) { + if (messageContent.equalsIgnoreCase(COMMAND + " Mangrove") || messageContent.equalsIgnoreCase(COMMAND + " A")) { + points++; + event.getChannel().sendMessage("Correct! Adding one point to your score. Alright onto the next question!"); + event.getChannel().sendMessage("Your final score is " + points+" points!"); + questionNumber=0; + } + else{ + event.getChannel().sendMessage("Ooh, so close. Sadly we cannot give points for incorrect answers. Alright onto the next question!"); + event.getChannel().sendMessage("Your final score is " + points+" points!"); + questionNumber=0; + } + } + + } +} diff --git a/src/test/java/org/jointheleague/features/examples/first_features/CurrentTimeTest.java b/src/test/java/org/jointheleague/features/examples/first_features/CurrentTimeTest.java index 7b2cccad..e25f7b25 100644 --- a/src/test/java/org/jointheleague/features/examples/first_features/CurrentTimeTest.java +++ b/src/test/java/org/jointheleague/features/examples/first_features/CurrentTimeTest.java @@ -82,7 +82,7 @@ void itShouldNotHandleMessagesWithoutCommand() { currentTime.handle(messageCreateEvent); //Then - verify(textChannel, never()).sendMessage(); + verify(textChannel, never()).sendMessage(""); } @Test diff --git a/src/test/java/org/jointheleague/features/examples/first_features/RandomNumberTest.java b/src/test/java/org/jointheleague/features/examples/first_features/RandomNumberTest.java index 1b84ccb3..956f2b60 100644 --- a/src/test/java/org/jointheleague/features/examples/first_features/RandomNumberTest.java +++ b/src/test/java/org/jointheleague/features/examples/first_features/RandomNumberTest.java @@ -81,7 +81,7 @@ void itShouldNotHandleMessagesWithoutCommand() { randomNumber.handle(messageCreateEvent); //Then - verify(textChannel, never()).sendMessage(); + verify(textChannel, never()).sendMessage(""); } @Test diff --git a/src/test/java/org/jointheleague/features/examples/second_features/HighLowGameTest.java b/src/test/java/org/jointheleague/features/examples/second_features/HighLowGameTest.java index f67c50f7..3874bcad 100644 --- a/src/test/java/org/jointheleague/features/examples/second_features/HighLowGameTest.java +++ b/src/test/java/org/jointheleague/features/examples/second_features/HighLowGameTest.java @@ -82,7 +82,7 @@ void itShouldNotHandleMessagesWithoutCommand() { highLowGame.handle(messageCreateEvent); //Then - verify(textChannel, never()).sendMessage(); + verify(textChannel, never()).sendMessage(""); } @Test diff --git a/src/test/java/org/jointheleague/features/examples/third_features/CatFactsApiTest.java b/src/test/java/org/jointheleague/features/examples/third_features/CatFactsApiTest.java index 31eec24f..6590d6b8 100644 --- a/src/test/java/org/jointheleague/features/examples/third_features/CatFactsApiTest.java +++ b/src/test/java/org/jointheleague/features/examples/third_features/CatFactsApiTest.java @@ -150,7 +150,7 @@ void givenMessageWithoutCommand_whenHandle_thenDoNothing() { catFactsApi.handle(messageCreateEvent); //Then - verify(textChannel, never()).sendMessage(); + verify(textChannel, never()).sendMessage(""); } } \ No newline at end of file diff --git a/src/test/java/org/jointheleague/features/examples/third_features/NewsApiTest.java b/src/test/java/org/jointheleague/features/examples/third_features/NewsApiTest.java index a8bd08fe..44f9c744 100644 --- a/src/test/java/org/jointheleague/features/examples/third_features/NewsApiTest.java +++ b/src/test/java/org/jointheleague/features/examples/third_features/NewsApiTest.java @@ -178,7 +178,7 @@ void givenMessageWithoutCommand_whenHandle_thenDoNothing() { newsApi.handle(messageCreateEvent); //Then - verify(textChannel, never()).sendMessage(); + verify(textChannel, never()).sendMessage(""); } } \ No newline at end of file diff --git a/src/test/java/org/jointheleague/features/student/second_feature/FeatureTwoTest.java b/src/test/java/org/jointheleague/features/student/second_feature/FeatureTwoTest.java new file mode 100644 index 00000000..327bf0a5 --- /dev/null +++ b/src/test/java/org/jointheleague/features/student/second_feature/FeatureTwoTest.java @@ -0,0 +1,131 @@ +package org.jointheleague.features.student.second_feature; + +import org.javacord.api.entity.channel.TextChannel; +import org.javacord.api.event.message.MessageCreateEvent; +import org.jointheleague.features.help_embed.plain_old_java_objects.help_embed.HelpEmbed; +import org.jointheleague.features.templates.FeatureTemplate; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; + +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.*; +import static org.mockito.Mockito.never; + +public class FeatureTwoTest { + private final String testChannelName = "test"; + private final FeatureTwo featureTwo = new FeatureTwo(testChannelName); + + private final ByteArrayOutputStream outContent = new ByteArrayOutputStream(); + private final PrintStream originalOut = System.out; + + @Mock + private MessageCreateEvent messageCreateEvent; + + @Mock + private TextChannel textChannel; + + @BeforeEach + void setUp() { + MockitoAnnotations.openMocks(this); + System.setOut(new PrintStream(outContent)); + } + + @AfterEach + public void itShouldNotPrintToSystemOut() { + String expected = ""; + String actual = outContent.toString(); + + assertEquals(expected, actual); + System.setOut(originalOut); + } + + @Test + void itShouldHaveACommand() { + //Given + + //When + String command = featureTwo.COMMAND; + + //Then + + if(!(featureTwo instanceof FeatureTemplate)){ + assertNotEquals("!command", command); + } + + assertNotEquals("", command); + assertNotEquals("!", command); + assertEquals('!', command.charAt(0)); + assertNotNull(command); + } + + @Test + void itShouldHandleMessagesWithCommand() { + //Given + HelpEmbed helpEmbed = new HelpEmbed(featureTwo.COMMAND, "test"); + when(messageCreateEvent.getMessageContent()).thenReturn(featureTwo.COMMAND); + when(messageCreateEvent.getChannel()).thenReturn((textChannel)); + + //When + featureTwo.handle(messageCreateEvent); + + //Then + verify(textChannel, times(1)).sendMessage(anyString()); + } + + @Test + void itShouldNotHandleMessagesWithoutCommand() { + //Given + String command = ""; + when(messageCreateEvent.getMessageContent()).thenReturn(command); + + //When + featureTwo.handle(messageCreateEvent); + + //Then + verify(textChannel, never()).sendMessage(""); + } + + @Test + void itShouldHaveAHelpEmbed() { + //Given + + //When + HelpEmbed actualHelpEmbed = featureTwo.getHelpEmbed(); + + //Then + assertNotNull(actualHelpEmbed); + } + + @Test + void itShouldHaveTheCommandAsTheTitleOfTheHelpEmbed() { + //Given + + //When + String helpEmbedTitle = featureTwo.getHelpEmbed().getTitle(); + String command = featureTwo.COMMAND; + + //Then + assertEquals(command, helpEmbedTitle); + } + +//void itShouldNotAcceptGuessIfGameIsNotStarted(){ + // Do the same thing as HighLowGameTest.java + //} + +//void itShouldTellUserTheirAnswerIsCorrect(){ + //Have it check point addition, message printing, and other things related to the answer being correct/incorrect. + //} + +//void itShouldTellUserTheirAnswerIsIncorrect(){ + //Have it check point addition, message printing, and other things related to the answer being correct/incorrect. + //} +} diff --git a/src/test/java/org/jointheleague/features/templates/FeatureTemplateTest.java b/src/test/java/org/jointheleague/features/templates/FeatureTemplateTest.java index 8d4ef733..f40ad152 100644 --- a/src/test/java/org/jointheleague/features/templates/FeatureTemplateTest.java +++ b/src/test/java/org/jointheleague/features/templates/FeatureTemplateTest.java @@ -92,7 +92,7 @@ void itShouldNotHandleMessagesWithoutCommand() { featureTemplate.handle(messageCreateEvent); //Then - verify(textChannel, never()).sendMessage(); + verify(textChannel, never()).sendMessage(""); } @Test From 4be51f29898727b655d0211a7d13ad34fe2844c7 Mon Sep 17 00:00:00 2001 From: Branson778 Date: Sun, 10 Sep 2023 15:14:06 -0700 Subject: [PATCH 2/2] Finished with FeatureTwo and FeatureTwoTest --- .../student/second_feature/FeatureTwo.java | 14 +++---- .../second_feature/FeatureTwoTest.java | 42 +++++++++++++++---- 2 files changed, 41 insertions(+), 15 deletions(-) diff --git a/src/main/java/org/jointheleague/features/student/second_feature/FeatureTwo.java b/src/main/java/org/jointheleague/features/student/second_feature/FeatureTwo.java index 005101d7..9a30038b 100644 --- a/src/main/java/org/jointheleague/features/student/second_feature/FeatureTwo.java +++ b/src/main/java/org/jointheleague/features/student/second_feature/FeatureTwo.java @@ -35,7 +35,7 @@ else if(messageContent.contains(COMMAND) && questionNumber == 0){ event.getChannel().sendMessage("Please be sure to start the game before adding any answer prompt. Start the game by typing !\u200Epopquiz."); } else if (messageContent.contains(COMMAND) && questionNumber == 1){ - if(messageContent.equalsIgnoreCase(COMMAND+" Supercooling") || messageContent.equalsIgnoreCase(COMMAND+" B")){ + if(messageContent.equalsIgnoreCase(COMMAND+" Supercooling") || messageContent.equalsIgnoreCase(COMMAND+" B") || messageContent.equalsIgnoreCase(COMMAND + " 2")){ points++; event.getChannel().sendMessage("Correct! Adding one point to your score. Alright onto the next question!"); questionNumber++; @@ -48,7 +48,7 @@ else if (messageContent.contains(COMMAND) && questionNumber == 1){ } } else if (messageContent.contains(COMMAND) && questionNumber ==2){ - if(messageContent.equalsIgnoreCase(COMMAND + " Oganesson") || messageContent.equalsIgnoreCase(COMMAND + " G")){ + if(messageContent.equalsIgnoreCase(COMMAND + " Oganesson") || messageContent.equalsIgnoreCase(COMMAND + " G") || messageContent.equalsIgnoreCase(COMMAND + " 7")){ points++; event.getChannel().sendMessage("Correct! Adding one point to your score. Alright onto the next question!"); questionNumber++; @@ -61,7 +61,7 @@ else if (messageContent.contains(COMMAND) && questionNumber ==2){ } } else if (messageContent.contains(COMMAND) && questionNumber ==3){ - if(messageContent.equalsIgnoreCase(COMMAND + " Yes, (almost) all elements can be magnetic with electromagnetism.") || messageContent.equalsIgnoreCase(COMMAND + " B")){ + if(messageContent.equalsIgnoreCase(COMMAND + " Yes, (almost) all elements can be magnetic with electromagnetism.") || messageContent.equalsIgnoreCase(COMMAND + " B") || messageContent.equalsIgnoreCase(COMMAND + " 2")){ points++; event.getChannel().sendMessage("Correct! Adding one point to your score. Alright onto the next question!"); questionNumber++; @@ -74,7 +74,7 @@ else if (messageContent.contains(COMMAND) && questionNumber ==3){ } } else if (messageContent.contains(COMMAND) && questionNumber ==4) { - if (messageContent.equalsIgnoreCase(COMMAND + " Limestone, which is made up of Calcite") || messageContent.equalsIgnoreCase(COMMAND + " B")) { + if (messageContent.equalsIgnoreCase(COMMAND + " Limestone, which is made up of Calcite") || messageContent.equalsIgnoreCase(COMMAND + " B") || messageContent.equalsIgnoreCase(COMMAND + " 2")) { points++; event.getChannel().sendMessage("Correct! Adding one point to your score. Alright onto the next question!"); questionNumber++; @@ -87,14 +87,14 @@ else if (messageContent.contains(COMMAND) && questionNumber ==4) { } } else if (messageContent.contains(COMMAND) && questionNumber ==5) { - if (messageContent.equalsIgnoreCase(COMMAND + " Mangrove") || messageContent.equalsIgnoreCase(COMMAND + " A")) { + if (messageContent.equalsIgnoreCase(COMMAND + " Mangrove") || messageContent.equalsIgnoreCase(COMMAND + " A") || messageContent.equalsIgnoreCase(COMMAND + " 1")) { points++; - event.getChannel().sendMessage("Correct! Adding one point to your score. Alright onto the next question!"); + event.getChannel().sendMessage("Correct! Adding one point to your score. Time to tally your final score!"); event.getChannel().sendMessage("Your final score is " + points+" points!"); questionNumber=0; } else{ - event.getChannel().sendMessage("Ooh, so close. Sadly we cannot give points for incorrect answers. Alright onto the next question!"); + event.getChannel().sendMessage("Ooh, so close. Sadly we cannot give points for incorrect answers. Time to tally your final score!"); event.getChannel().sendMessage("Your final score is " + points+" points!"); questionNumber=0; } diff --git a/src/test/java/org/jointheleague/features/student/second_feature/FeatureTwoTest.java b/src/test/java/org/jointheleague/features/student/second_feature/FeatureTwoTest.java index 327bf0a5..cce29c33 100644 --- a/src/test/java/org/jointheleague/features/student/second_feature/FeatureTwoTest.java +++ b/src/test/java/org/jointheleague/features/student/second_feature/FeatureTwoTest.java @@ -116,16 +116,42 @@ void itShouldHaveTheCommandAsTheTitleOfTheHelpEmbed() { //Then assertEquals(command, helpEmbedTitle); } - -//void itShouldNotAcceptGuessIfGameIsNotStarted(){ +@Test +void itShouldNotAcceptGuessIfGameIsNotStarted(){ // Do the same thing as HighLowGameTest.java - //} + String command = "!popquiz do something"; + when(messageCreateEvent.getMessageContent()).thenReturn(command); + when(messageCreateEvent.getChannel()).thenReturn(textChannel); -//void itShouldTellUserTheirAnswerIsCorrect(){ - //Have it check point addition, message printing, and other things related to the answer being correct/incorrect. - //} + featureTwo.handle(messageCreateEvent); -//void itShouldTellUserTheirAnswerIsIncorrect(){ + verify(textChannel, times(1)).sendMessage("Please be sure to start the game before adding any answer prompt. Start the game by typing !\u200Epopquiz."); + } +@Test +void itShouldTellUserTheirAnswerIsCorrect(){ + featureTwo.questionNumber = 5; + featureTwo.points = 4; + String command = "!popquiz A"; + when(messageCreateEvent.getMessageContent()).thenReturn(command); + when(messageCreateEvent.getChannel()).thenReturn(textChannel); + + featureTwo.handle(messageCreateEvent); + + verify(textChannel, times(1)).sendMessage("Correct! Adding one point to your score. Time to tally your final score!"); + assertEquals(5, featureTwo.points); + } +@Test +void itShouldTellUserTheirAnswerIsIncorrect(){ //Have it check point addition, message printing, and other things related to the answer being correct/incorrect. - //} + featureTwo.questionNumber = 5; + featureTwo.points = 4; + String command = "!popquiz C"; + when(messageCreateEvent.getMessageContent()).thenReturn(command); + when(messageCreateEvent.getChannel()).thenReturn(textChannel); + + featureTwo.handle(messageCreateEvent); + + verify(textChannel, times(1)).sendMessage("Ooh, so close. Sadly we cannot give points for incorrect answers. Time to tally your final score!"); + assertEquals(4, featureTwo.points); + } }