Beispiel #1
0
    def test__correct_army_given(self):
        t1 = Army()

        # Test if a (low) valid combination of unit values is accepted
        try:
            self.assertTrue(t1._Army__correct_army_given(1, 1, 1),
                            msg="Stack test 1,1,1 failed")
        except AssertionError as e:
            self.verificationErrors.append(str(e))

        # put your __correct_army tests here
        # simple test
        try:
            self.assertEqual(t1._Army__correct_army_given(1, 1, 1),
                             True,
                             msg="correct_army method failed")
        except AssertionError as e:
            self.verificationErrors.append(str(e))

        # Testing for negative inputs
        try:
            self.assertEqual(t1._Army__correct_army_given(-1, -1, 1),
                             False,
                             msg="correct_army method failed")
        except AssertionError as e:
            self.verificationErrors.append(str(e))

        # testing for over the budget inputs
        try:
            self.assertEqual(t1._Army__correct_army_given(21, 41, 1),
                             False,
                             msg="correct_army method failed")
        except AssertionError as e:
            self.verificationErrors.append(str(e))
Beispiel #2
0
    def test__correct_army_given(self):
        t1 = Army()

        # Test if a (low) valid combination of unit values is accepted
        try:
            self.assertTrue(t1._Army__correct_army_given(1, 1, 1),
                            msg="Stack test 1,1,1 failed")
        except AssertionError as e:
            self.verificationErrors.append(str(e))