use of fr.xephi.authme.command.CommandDescription in project AuthMeReloaded by AuthMe.
the class HelpProviderTest method shouldNotShowAnythingForNullPermissionsOnCommand.
@Test
public void shouldNotShowAnythingForNullPermissionsOnCommand() {
// given
CommandDescription command = mock(CommandDescription.class);
given(command.getPermission()).willReturn(null);
given(command.getLabels()).willReturn(Collections.singletonList("test"));
FoundCommandResult result = newFoundResult(command, Collections.singletonList("test"));
// when
helpProvider.outputHelp(sender, result, SHOW_PERMISSIONS);
// then
List<String> lines = getLines(sender);
assertThat(lines, hasSize(1));
}
use of fr.xephi.authme.command.CommandDescription in project AuthMeReloaded by AuthMe.
the class HelpProviderTest method shouldShowAlternatives.
@Test
public void shouldShowAlternatives() {
// given
CommandDescription command = getCommandWithLabel(commands, "authme", "register");
FoundCommandResult result = newFoundResult(command, Arrays.asList("authme", "reg"));
// when
helpProvider.outputHelp(sender, result, SHOW_ALTERNATIVES);
// then
List<String> lines = getLines(sender);
assertThat(lines, hasSize(4));
assertThat(lines.get(1), containsString("Alternatives:"));
assertThat(lines.get(2), containsString("/authme register <password> <confirmation>"));
assertThat(lines.get(3), containsString("/authme r <password> <confirmation>"));
}
use of fr.xephi.authme.command.CommandDescription in project AuthMeReloaded by AuthMe.
the class HelpProviderTest method shouldNotShowAnythingForEmptyPermissions.
@Test
public void shouldNotShowAnythingForEmptyPermissions() {
// given
CommandDescription command = getCommandWithLabel(commands, "authme");
FoundCommandResult result = newFoundResult(command, Collections.singletonList("authme"));
// when
helpProvider.outputHelp(sender, result, SHOW_PERMISSIONS);
// then
List<String> lines = getLines(sender);
assertThat(lines, hasSize(1));
}
Aggregations