Skip to content

Commit

Permalink
tests, find broken test
Browse files Browse the repository at this point in the history
  • Loading branch information
annechko committed Jan 25, 2024
1 parent e30b615 commit e8d2403
Showing 1 changed file with 14 additions and 22 deletions.
36 changes: 14 additions & 22 deletions tests/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ void test_add_car_when_register_as_admin_expect_car_created()
assert_has_text(buffer.str(), "Admin with username", __FUNCTION__);
assert_has_text(buffer.str(), "was created", __FUNCTION__);

// auto buffer_car = run_app(
// "car_rental_system car:add -u u -p p --make toyota --model x2 --year 2020 --price-per-day 1"
// );
//
// assert_has_text(buffer_car.str(), "Car", __FUNCTION__);
// assert_has_text(buffer_car.str(), "added", __FUNCTION__);
auto buffer_car = run_app(
"car_rental_system car:add -u u -p p --make toyota --model x2 --year 2020 --price-per-day 1"
);

assert_has_text(buffer_car.str(), "Car", __FUNCTION__);
assert_has_text(buffer_car.str(), "added", __FUNCTION__);
}

void add_admin()
Expand Down Expand Up @@ -341,14 +341,14 @@ int main()
[]() -> void { test_help_when_register_command_expect_no_other_commands(); },
[]() -> void { test_help_when_command_not_exist_expect_error(); },
[]() -> void { test_add_car_when_register_as_admin_expect_car_created(); },
// []() -> void { test_car_list_by_customer_when_car_created_by_admin_expect_customer_sees_car(); },
// []() -> void { test_calculate_rent_when_car_available_expect_correct_price(); },
// []() -> void { test_calculate_or_book_when_car_booked_expect_error_when_dates_not_available(); },
// []() -> void { test_book_car_when_car_available_expect_success_booking(); },
// []() -> void { test_add_car_when_register_as_customer_expect_failed_to_add(); },
// []() -> void { test_car_add_when_not_existed_user_expect_error(); },
// []() -> void { test_car_add_when_not_existed_user_expect_error2(); },
// []() -> void { test_create_user(); },
[]() -> void { test_car_list_by_customer_when_car_created_by_admin_expect_customer_sees_car(); },
[]() -> void { test_calculate_rent_when_car_available_expect_correct_price(); },
[]() -> void { test_calculate_or_book_when_car_booked_expect_error_when_dates_not_available(); },
[]() -> void { test_book_car_when_car_available_expect_success_booking(); },
[]() -> void { test_add_car_when_register_as_customer_expect_failed_to_add(); },
[]() -> void { test_car_add_when_not_existed_user_expect_error(); },
[]() -> void { test_car_add_when_not_existed_user_expect_error2(); },
[]() -> void { test_create_user(); },
};
for (auto& test : tests)
{
Expand All @@ -362,14 +362,6 @@ int main()
res = 1;
show_error_msg(exception.what(), __FUNCTION__);
}
catch (int e)
{
show_error_msg(std::to_string(e), __FUNCTION__);
}
catch (...)
{
show_error_msg(__FUNCTION__);
}
}

if (res == 0)
Expand Down

0 comments on commit e8d2403

Please sign in to comment.