1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Test "/account show" when no account does not exist

This commit is contained in:
James Booth 2013-12-15 23:22:22 +00:00
parent 8aaca1054f
commit 838e6e1f5b
3 changed files with 19 additions and 0 deletions

View File

@ -84,3 +84,20 @@ void cmd_account_show_shows_usage_when_no_arg(void **state)
free(help);
}
void cmd_account_show_shows_message_when_account_does_not_exist(void **state)
{
CommandHelp *help = malloc(sizeof(CommandHelp));
gchar *args[] = { "show", "account_name" };
expect_string(accounts_get_account, name, "account_name");
will_return(accounts_get_account, NULL);
expect_string(cons_show, output, "No such account.");
expect_string(cons_show, output, "");
gboolean result = cmd_account(args, *help);
assert_true(result);
free(help);
}

View File

@ -2,3 +2,4 @@ void cmd_account_shows_usage_when_not_connected_and_no_args(void **state);
void cmd_account_shows_account_when_connected_and_no_args(void **state);
void cmd_account_list_shows_accounts(void **state);
void cmd_account_show_shows_usage_when_no_arg(void **state);
void cmd_account_show_shows_message_when_account_does_not_exist(void **state);

View File

@ -32,6 +32,7 @@ int main(int argc, char* argv[]) {
unit_test(cmd_account_shows_account_when_connected_and_no_args),
unit_test(cmd_account_list_shows_accounts),
unit_test(cmd_account_show_shows_usage_when_no_arg),
unit_test(cmd_account_show_shows_message_when_account_does_not_exist),
unit_test(cmd_rooms_shows_message_when_disconnected),
unit_test(cmd_rooms_shows_message_when_disconnecting),