def test_get_neighbors_of_cell_should_return_all_neighbors(self): cell = (1, 1) result = get_neighbors_of(cell) expected = { (0, 0), (0, 1), (0, 2), (1, 0), (1, 2), (2, 0), (2, 1), (2, 2), } self.assertEqual(result, expected)
def test_get_neighbors_of_cell_one_one_should_return_neighbors(self): cell = (1, 1) result = get_neighbors_of(cell) self.assertEqual(result, {(0, 0), (0, 1), (0, 2), (1, 0), (1, 2), (2, 0), (2, 1), (2, 2)})
def test_zero_neighbors(self): result = get_neighbors_of((1, 1), {(1, 1)}) self.assertEqual(result, 0)
def test__neighbors(self): result = get_neighbors_of((1, 1), {(0, 1), (1, 1)}) self.assertEqual(result, 1)
def test_get_neighbors_of_cell_should_return_one(self): cell = (0, 3) result = get_neighbors_of(cell) self.assertEqual(result, 1)