diff --git a/tests/test_cmd_account.c b/tests/test_cmd_account.c index 1a14159d..842ad13f 100644 --- a/tests/test_cmd_account.c +++ b/tests/test_cmd_account.c @@ -120,3 +120,17 @@ void cmd_account_show_shows_message_when_account_exists(void **state) free(help); } + +void cmd_account_add_shows_usage_when_no_arg(void **state) +{ + CommandHelp *help = malloc(sizeof(CommandHelp)); + help->usage = "some usage"; + gchar *args[] = { "add", NULL }; + + expect_string(cons_show, output, "Usage: some usage"); + + 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 4109d807..9b7a4f4b 100644 --- a/tests/test_cmd_account.h +++ b/tests/test_cmd_account.h @@ -4,3 +4,4 @@ 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); void cmd_account_show_shows_message_when_account_exists(void **state); +void cmd_account_add_shows_usage_when_no_arg(void **state); diff --git a/tests/testsuite.c b/tests/testsuite.c index 404fa1a4..2c6789be 100644 --- a/tests/testsuite.c +++ b/tests/testsuite.c @@ -34,6 +34,7 @@ int main(int argc, char* argv[]) { 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_account_show_shows_message_when_account_exists), + unit_test(cmd_account_add_shows_usage_when_no_arg), unit_test(cmd_rooms_shows_message_when_disconnected), unit_test(cmd_rooms_shows_message_when_disconnecting),