Search in sources :

Example 1 with IfConditionElseArgument

use of io.github.nucleuspowered.nucleus.argumentparsers.IfConditionElseArgument in project Nucleus by NucleusPowered.

the class IfConditionElseArgumentTests method process.

private boolean process(BiPredicate<CommandSource, CommandContext> cond) throws Exception {
    // Get the element
    CommandSource source = Mockito.mock(CommandSource.class);
    CommandArgs args = new CommandArgs("", Lists.newArrayList());
    CommandContext context = new CommandContext();
    new IfConditionElseArgument(new TrueArgument(), new FalseArgument(), cond).parse(source, args, context);
    return context.<Boolean>getOne("key").orElseThrow(NullPointerException::new);
}
Also used : CommandArgs(org.spongepowered.api.command.args.CommandArgs) CommandContext(org.spongepowered.api.command.args.CommandContext) IfConditionElseArgument(io.github.nucleuspowered.nucleus.argumentparsers.IfConditionElseArgument) CommandSource(org.spongepowered.api.command.CommandSource)

Aggregations

IfConditionElseArgument (io.github.nucleuspowered.nucleus.argumentparsers.IfConditionElseArgument)1 CommandSource (org.spongepowered.api.command.CommandSource)1 CommandArgs (org.spongepowered.api.command.args.CommandArgs)1 CommandContext (org.spongepowered.api.command.args.CommandContext)1