Ejemplo n.º 1
0
    def test_integerListGet_whenIndexIsInvalid_shouldRaise(self):
        il = IntegerList(1, 2, 3, 4, 5, 6, 7)

        with self.assertRaises(Exception) as context:
            il.get(len(il.get_data()))

        self.assertIsNotNone(context.exception)
Ejemplo n.º 2
0
    def test_integerListGet_whenIndexIsValid_shouldReturnIt(self):
        il = IntegerList(1, 2, 3, 4, 5, 6, 7)
        returned = il.get(3)

        self.assertEqual(4, returned)