aboutsummaryrefslogtreecommitdiff
path: root/test/cell_helper_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/cell_helper_test.cpp')
-rw-r--r--test/cell_helper_test.cpp37
1 files changed, 3 insertions, 34 deletions
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<MockMatrix<char>>();
-
- auto cell_helper = CellHelper<char>(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<Vector2>(
- {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);
}
}