diff --git a/tests/test_cmd_account.c b/tests/test_cmd_account.c index f6f14366..6a6cb062 100644 --- a/tests/test_cmd_account.c +++ b/tests/test_cmd_account.c @@ -149,3 +149,19 @@ void cmd_account_add_adds_account(void **state) free(help); } + +void cmd_account_add_shows_message(void **state) +{ + CommandHelp *help = malloc(sizeof(CommandHelp)); + gchar *args[] = { "add", "new_account", NULL }; + + expect_any(accounts_add, jid); + + expect_string(cons_show, output, "Account created.");; + expect_string(cons_show, output, ""); + + gboolean result = cmd_account(args, *help); + assert_true(result); + + free(help); +} diff --git a/tests/test_cmd_account.h b/tests/test_cmd_account.h index be3a420d..5a8e552d 100644 --- a/tests/test_cmd_account.h +++ b/tests/test_cmd_account.h @@ -6,3 +6,4 @@ void cmd_account_show_shows_message_when_account_does_not_exist(void **state); void cmd_account_show_shows_message_when_account_exists(void **state); void cmd_account_add_shows_usage_when_no_arg(void **state); void cmd_account_add_adds_account(void **state); +void cmd_account_add_shows_message(void **state); diff --git a/tests/testsuite.c b/tests/testsuite.c index cdf07b73..a199d2d7 100644 --- a/tests/testsuite.c +++ b/tests/testsuite.c @@ -36,6 +36,7 @@ int main(int argc, char* argv[]) { unit_test(cmd_account_show_shows_message_when_account_exists), unit_test(cmd_account_add_shows_usage_when_no_arg), unit_test(cmd_account_add_adds_account), + unit_test(cmd_account_add_shows_message), unit_test(cmd_rooms_shows_message_when_disconnected), unit_test(cmd_rooms_shows_message_when_disconnecting),