def test_gives_correct_result_1(self): game = GameOfLife() game.grid = [ [True, True, True], [True, True, True], [True, True, True] ] self.assertEqual( game.number_of_neighbours(1, 1, game.grid), 8 )
def test_doesnt_crash_on_edges2(self): game = GameOfLife() game.grid = [ [False, False, False], [False, True, True], [False, False, False] ] self.assertEqual( game.number_of_neighbours(0, 2, game.grid), 2 )
def test_gives_correct_result_2(self): game = GameOfLife() game.grid = [ [False, False, False], [False, False, False], [False, False, False] ] self.assertEqual( game.number_of_neighbours(1, 1, game.grid), 0 )