aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-07-01 16:27:15 +0200
committerHampusM <hampus@hampusmat.com>2022-07-01 16:27:15 +0200
commit0fca054fdc11dba086541e2d5a48f6f1406925dd (patch)
treebbb7e693c7c71122c0c12970a659d39081a544fd /test
parent7307815e99a79dac42f2a9c06b0fe6171ea11ba0 (diff)
refactor: clarify cell helper method names
Diffstat (limited to 'test')
-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);
}
}