From 0fca054fdc11dba086541e2d5a48f6f1406925dd Mon Sep 17 00:00:00 2001 From: HampusM Date: Fri, 1 Jul 2022 16:27:15 +0200 Subject: refactor: clarify cell helper method names --- test/cell_helper_test.cpp | 37 +++---------------------------------- 1 file changed, 3 insertions(+), 34 deletions(-) (limited to 'test') diff --git a/test/cell_helper_test.cpp b/test/cell_helper_test.cpp index 36f2a62..01c26b4 100644 --- a/test/cell_helper_test.cpp +++ b/test/cell_helper_test.cpp @@ -84,7 +84,7 @@ TEST_CASE("CellHelper") .RETURN(' ') .IN_SEQUENCE(matrix_call_seq); - REQUIRE(cell_helper.is_cell_dying(cell_pos) == true); + REQUIRE(cell_helper.compute_is_cell_dying(cell_pos) == true); REQUIRE_CALL(*mock_matrix, get(cell_pos_up)) // NOLINTNEXTLINE(readability-identifier-length) @@ -126,7 +126,7 @@ TEST_CASE("CellHelper") .RETURN(' ') .IN_SEQUENCE(matrix_call_seq); - REQUIRE(cell_helper.is_cell_dying(cell_pos) == false); + REQUIRE(cell_helper.compute_is_cell_dying(cell_pos) == false); REQUIRE_CALL(*mock_matrix, get(cell_pos_up)) // NOLINTNEXTLINE(readability-identifier-length) @@ -168,37 +168,6 @@ TEST_CASE("CellHelper") .RETURN(' ') .IN_SEQUENCE(matrix_call_seq); - REQUIRE(cell_helper.is_cell_dying(cell_pos) == true); - } - - SECTION("can find neighbours") - { - auto mock_matrix = std::make_shared>(); - - auto cell_helper = CellHelper(mock_matrix); - - constexpr auto MATRIX_ROWS = 12U; - constexpr auto MATRIX_COLUMNS = 9U; - - const auto cell_pos = Vector2({.x = 8, .y = 3}); - - // NOLINTNEXTLINE(readability-identifier-length) - REQUIRE_CALL(*mock_matrix, get_row_cnt()).RETURN(MATRIX_ROWS); - - // NOLINTNEXTLINE(readability-identifier-length) - REQUIRE_CALL(*mock_matrix, get_column_cnt()).RETURN(MATRIX_COLUMNS); - - const auto living_neighbour_cells = cell_helper.find_neighbours(cell_pos); - - REQUIRE(living_neighbour_cells.size() == 5U); - - REQUIRE_THAT( - living_neighbour_cells, - Catch::Matchers::Contains(std::vector( - {cell_pos + Vector2::up(), - cell_pos + Vector2::down(), - cell_pos + Vector2::left(), - cell_pos + Vector2::up() + Vector2::left(), - cell_pos + Vector2::down() + Vector2::left()}))); + REQUIRE(cell_helper.compute_is_cell_dying(cell_pos) == true); } } -- cgit v1.2.3-18-g5258