-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathWikiCommandTest.java
More file actions
48 lines (38 loc) · 1.1 KB
/
WikiCommandTest.java
File metadata and controls
48 lines (38 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package oakbot.command;
import static oakbot.bot.ChatActionsUtils.assertMessage;
import org.junit.jupiter.api.Test;
import oakbot.util.ChatCommandBuilder;
/**
* @author Michael Angstadt
*/
class WikiCommandTest {
private final WikiCommand command = new WikiCommand();
@Test
void empty() {
var message = new ChatCommandBuilder(command).messageId(1).build();
var response = command.onMessage(message, null);
assertMessage("Please specify the term you'd like to display.", 1, response);
}
@Test
void spaces() {
//@formatter:off
var message = new ChatCommandBuilder(command)
.messageId(1)
.content("John Doe")
.build();
//@formatter:on
var response = command.onMessage(message, null);
assertMessage("https://en.wikipedia.org/wiki/John_Doe", response);
}
@Test
void url_safe() {
//@formatter:off
var message = new ChatCommandBuilder(command)
.messageId(1)
.content("I/O")
.build();
//@formatter:on
var response = command.onMessage(message, null);
assertMessage("https://en.wikipedia.org/wiki/I%2FO", response);
}
}