Search in sources :

Example 21 with CommandArgs

use of org.spongepowered.api.command.args.CommandArgs in project Nucleus by NucleusPowered.

the class PlayerConsoleArgumentTest method testWhenTwoPlayersWithTheSameNameAreInTheUserDatabaseWithNoExactMatchReturnsBothIfTheyOtherwiseMatch.

@Test
public void testWhenTwoPlayersWithTheSameNameAreInTheUserDatabaseWithNoExactMatchReturnsBothIfTheyOtherwiseMatch() throws ArgumentParseException {
    List<?> list = getParser().parseInternal("tes", mockSource(), new CommandArgs("", new ArrayList<>()));
    Assert.assertEquals(2, list.size());
}
Also used : CommandArgs(org.spongepowered.api.command.args.CommandArgs) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Aggregations

CommandArgs (org.spongepowered.api.command.args.CommandArgs)21 CommandContext (org.spongepowered.api.command.args.CommandContext)12 ArrayList (java.util.ArrayList)10 CommandSource (org.spongepowered.api.command.CommandSource)10 CommandElement (org.spongepowered.api.command.args.CommandElement)8 List (java.util.List)7 Test (org.junit.Test)7 Nullable (javax.annotation.Nullable)6 ArgumentParseException (org.spongepowered.api.command.args.ArgumentParseException)6 StartsWithPredicate (org.spongepowered.api.util.StartsWithPredicate)6 Text (org.spongepowered.api.text.Text)5 TranslationHelper.t (org.lanternpowered.server.text.translation.TranslationHelper.t)4 CommandResult (org.spongepowered.api.command.CommandResult)4 GenericArguments (org.spongepowered.api.command.args.GenericArguments)4 CommandSpec (org.spongepowered.api.command.spec.CommandSpec)4 PluginContainer (org.spongepowered.api.plugin.PluginContainer)4 ImmutableList (com.google.common.collect.ImmutableList)3 Collectors (java.util.stream.Collectors)3 CommandException (org.spongepowered.api.command.CommandException)3 HashMap (java.util.HashMap)2