Search in sources :

Example 1 with Completion

use of com.karuslabs.commons.command.completion.Completion in project Karus-Commons by Pante.

the class CommandTest method complete_completions.

@Test
void complete_completions() {
    Arguments arguments = new Arguments("argument");
    Completion completion = when(mock(Completion.class).complete(sender, "argument")).thenReturn(singletonList("a")).getMock();
    command.getCompletions().put(0, completion);
    assertEquals(singletonList("a"), command.complete(sender, arguments));
    verify(completion).complete(sender, "argument");
}
Also used : Completion(com.karuslabs.commons.command.completion.Completion) Arguments(com.karuslabs.commons.command.arguments.Arguments) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

Arguments (com.karuslabs.commons.command.arguments.Arguments)1 Completion (com.karuslabs.commons.command.completion.Completion)1 Test (org.junit.jupiter.api.Test)1 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)1