use of org.terasology.engine.logic.console.commandSystem.MethodCommand in project Terasology by MovingBlocks.
the class ComponentSystemManagerTest method shouldRegisterCommand.
@Test
public void shouldRegisterCommand() {
systemUnderTest.register(new SystemWithValidCommand());
systemUnderTest.initialise();
ArgumentCaptor<MethodCommand> methodCommandArgumentCaptor = ArgumentCaptor.forClass(MethodCommand.class);
verify(console).registerCommand(methodCommandArgumentCaptor.capture());
MethodCommand command = methodCommandArgumentCaptor.getValue();
assertEquals(command.getName().toString(), "validCommandName");
}
use of org.terasology.engine.logic.console.commandSystem.MethodCommand in project Terasology by MovingBlocks.
the class ComponentSystemManagerTest method shouldRegisterCommandWithoutSenderAnnotation.
@Test
public void shouldRegisterCommandWithoutSenderAnnotation() {
// see https://github.com/MovingBlocks/Terasology/issues/2679
systemUnderTest.register(new SystemWithCommandMissingSenderAnnotation());
systemUnderTest.initialise();
ArgumentCaptor<MethodCommand> methodCommandArgumentCaptor = ArgumentCaptor.forClass(MethodCommand.class);
verify(console).registerCommand(methodCommandArgumentCaptor.capture());
MethodCommand command = methodCommandArgumentCaptor.getValue();
assertEquals(command.getName().toString(), "commandWithoutSenderAnnotation");
}
Aggregations