Search in sources :

Example 1 with FakeContext

use of fredboat.test.FakeContext in project FredBoat by Frederikam.

the class CommandInitializerTest method testHelpStrings.

/**
 * Make sure all commands initialized in the bot provide help
 */
// @Test disabled until spring refactoring is sorted out
public void testHelpStrings() {
    CommandInitializer.initCommands(null, null, null, null, null, null, null);
    for (String c : CommandRegistry.getAllRegisteredCommandsAndAliases()) {
        Command com = CommandRegistry.findCommand(c);
        Assertions.assertNotNull(com, "Command looked up by " + c + " is null");
        String help = com.help(new FakeContext(null, null, null));
        Assertions.assertNotNull(help, () -> com.getClass().getName() + ".help() returns null");
        Assertions.assertNotEquals("", help, () -> com.getClass().getName() + ".help() returns an empty string");
    }
}
Also used : Command(fredboat.commandmeta.abs.Command) FakeContext(fredboat.test.FakeContext)

Aggregations

Command (fredboat.commandmeta.abs.Command)1 FakeContext (fredboat.test.FakeContext)1