Exemple #1
0
    def test_add_single_item_to_box_package(self):
        height = 1.0
        width = 2.0
        depth = 3.0
        weight = 0.3

        package = BoxPackage()
        package.add_item(height, width, depth, weight)

        self.assertTrue(package.has_items())
        self.assertEqual(height, package.get_items()[0].height)
        self.assertEqual(width, package.get_items()[0].width)
        self.assertEqual(depth, package.get_items()[0].depth)
        self.assertEqual(weight, package.get_items()[0].weight)
Exemple #2
0
    def test_add_multiple_items_to_box_package(self):
        height0 = 1.0
        width0 = 2.0
        depth0 = 3.0
        weight0 = 0.3

        height1 = 2.0
        width1 = 3.0
        depth1 = 4.0
        weight1 = 1.0

        package = BoxPackage()
        package.add_item(height0, width0, depth0, weight0)
        package.add_item(height1, width1, depth1, weight1)

        self.assertTrue(package.has_items())

        self.assertEqual(height0, package.get_items()[0].height)
        self.assertEqual(width0, package.get_items()[0].width)
        self.assertEqual(depth0, package.get_items()[0].depth)
        self.assertEqual(weight0, package.get_items()[0].weight)

        self.assertEqual(height1, package.get_items()[1].height)
        self.assertEqual(width1, package.get_items()[1].width)
        self.assertEqual(depth1, package.get_items()[1].depth)
        self.assertEqual(weight1, package.get_items()[1].weight)