Added tests for "/account set <status> <priority>" with invalid status

This commit is contained in:
James Booth
2013-12-17 23:23:11 +00:00
parent 76e7a8341b
commit ba66d6b730
3 changed files with 38 additions and 0 deletions

View File

@@ -805,3 +805,37 @@ void cmd_account_set_status_shows_message_when_set_last(void **state)
free(help);
}
void cmd_account_set_invalid_presence_string_priority_shows_message(void **state)
{
CommandHelp *help = malloc(sizeof(CommandHelp));
gchar *args[] = { "set", "a_account", "blah", "10", NULL };
expect_any(accounts_account_exists, account_name);
will_return(accounts_account_exists, TRUE);
expect_string(cons_show, output, "Invalid property: blah");
expect_string(cons_show, output, "");
gboolean result = cmd_account(args, *help);
assert_true(result);
free(help);
}
void cmd_account_set_last_priority_shows_message(void **state)
{
CommandHelp *help = malloc(sizeof(CommandHelp));
gchar *args[] = { "set", "a_account", "last", "10", NULL };
expect_any(accounts_account_exists, account_name);
will_return(accounts_account_exists, TRUE);
expect_string(cons_show, output, "Invalid property: last");
expect_string(cons_show, output, "");
gboolean result = cmd_account(args, *help);
assert_true(result);
free(help);
}