def test_set_alive_1_3(self): state = State(5, 5) self.assertFalse(state.is_alive(1, 3)) self.assertTrue(state.is_dead(1, 3)) state.set_alive(1, 3) self.assertTrue(state.is_alive(1, 3)) self.assertFalse(state.is_dead(1, 3))
def test_negativ_column(self): state = State(5, 5) self.assertFalse(state.is_alive(1, -1)) self.assertFalse(state.is_dead(1, -1))
def test_negativ_row(self): state = State(5, 5) self.assertFalse(state.is_alive(-1, 1)) self.assertFalse(state.is_dead(-1, 1))
def test_invalid_column(self): state = State(5, 5) self.assertFalse(state.is_alive(1, 5)) self.assertFalse(state.is_dead(1, 5))
def test_invalid_row(self): state = State(5, 5) self.assertFalse(state.is_alive(5, 1)) self.assertFalse(state.is_dead(5, 1))
def test_set_alive_2_4(self): state = State(5, 5) state.set_alive(2, 4) self.assertTrue(state.is_alive(2, 4))