Package be.seeseemelk.mockbukkit.command
Class CommandResult
java.lang.Object
be.seeseemelk.mockbukkit.command.CommandResult
Represents the result of a command invocation.
-
Constructor Summary
ConstructorsConstructorDescriptionCommandResult(boolean success, @NotNull MessageTarget sender) Constructs a newCommandResultwith the provided parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoidAsserts if the returned code of the executed command is notfalse.voidAsserts if more messages have been sent to the command sender.voidassertResponse(@NotNull String format, Object... objects) Asserts if a given formatted message was not the next message sent to the command sender.voidassertResponse(String message) Assets if the given message was not the next message send to the command sender.voidAsserts if the returned code of the executed command is nottrue.booleanCheck if the command executed successfully.
-
Constructor Details
-
CommandResult
Constructs a newCommandResultwith the provided parameters.- Parameters:
success- Whether the command succeeded (returned true).sender- The message target who executed the command.
-
-
Method Details
-
hasSucceeded
public boolean hasSucceeded()Check if the command executed successfully.- Returns:
trueif the command executed successfully,falseif a problem occurred.
-
assertSucceeded
public void assertSucceeded()Asserts if the returned code of the executed command is nottrue. -
assertFailed
public void assertFailed()Asserts if the returned code of the executed command is notfalse. -
assertResponse
Assets if the given message was not the next message send to the command sender.- Parameters:
message- The message to check for.- See Also:
-
assertResponse
Asserts if a given formatted message was not the next message sent to the command sender.- Parameters:
format- The formatted message to check for.objects- The objects to place into the formatted message.- See Also:
-
assertNoResponse
public void assertNoResponse()Asserts if more messages have been sent to the command sender.- See Also:
-