Beispiel #1
0
 def test_bag_array3(self):
     bag = BagArray()
     self.assertEqual(0, bag.size())
     self.assertTrue(bag.is_empty())
     bag.add(1)
     self.assertEqual(1, bag.size())
     self.assertFalse(bag.is_empty())
Beispiel #2
0
 def test_bag_array4(self):
     bag = BagArray()
     self.assertEqual(0, bag.size())
     self.assertTrue(bag.is_empty())
     for i in range(32):
         bag.add(i)
     bag.add(32)
     self.assertEqual(33, bag.size())
     self.assertFalse(bag.is_empty())
Beispiel #3
0
 def test_bag_array2(self):
     # initialize an object
     s = BagArray()
     s.add(1)
     self.assertEqual(s.is_empty(), False)
     self.assertEqual(s.size(), 1)