Package be.seeseemelk.mockbukkit.command
Class CommandResult
java.lang.Object
be.seeseemelk.mockbukkit.command.CommandResult
Represents the result of a command invocation.
-
Constructor Summary
ConstructorDescriptionCommandResult
(boolean success, @NotNull MessageTarget sender) Constructs a newCommandResult
with the provided parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Asserts if the returned code of the executed command is notfalse
.void
Asserts if more messages have been sent to the command sender.void
assertResponse
(@NotNull String format, Object... objects) Asserts if a given formatted message was not the next message sent to the command sender.void
assertResponse
(String message) Assets if the given message was not the next message send to the command sender.void
Asserts if the returned code of the executed command is nottrue
.boolean
Check if the command executed successfully.
-
Constructor Details
-
CommandResult
Constructs a newCommandResult
with 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:
true
if the command executed successfully,false
if 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:
-