예제 #1
0
 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))
예제 #2
0
 def test_negativ_column(self):
     state = State(5, 5)
     self.assertFalse(state.is_alive(1, -1))
     self.assertFalse(state.is_dead(1, -1))
예제 #3
0
 def test_negativ_row(self):
     state = State(5, 5)
     self.assertFalse(state.is_alive(-1, 1))
     self.assertFalse(state.is_dead(-1, 1))
예제 #4
0
 def test_invalid_column(self):
     state = State(5, 5)
     self.assertFalse(state.is_alive(1, 5))
     self.assertFalse(state.is_dead(1, 5))
예제 #5
0
 def test_invalid_row(self):
     state = State(5, 5)
     self.assertFalse(state.is_alive(5, 1))
     self.assertFalse(state.is_dead(5, 1))
예제 #6
0
 def test_set_alive_2_4(self):
     state = State(5, 5)
     state.set_alive(2, 4)
     self.assertTrue(state.is_alive(2, 4))