class TestTeam(unittest.TestCase):

    def setUp(self):
        self.test_team = Team("Example Team")

    def tearDown(self):
        self.test_team = None

    def test_instatiation(self):
        self.assertEqual(self.test_team._name, "Example Team")
        self.assertEqual(self.test_team._rating, 0.0)
        self.assertEqual(self.test_team._performance, 0.0)
        self.assertEqual(self.test_team._scheduleFactor, 0.0)
        self.assertEqual(self.test_team._wins, 0)
        self.assertEqual(self.test_team._losses, 0)
        self.assertEqual(self.test_team._ties, 0)
        self.assertIsNone(self.test_team.next)

    def test_getTeam(self):
        self.assertEqual(self.test_team.getTeam(), "Example Team")

    def test_get_and_set_Rating(self):
        self.assertEqual(self.test_team.getRating(), 0.0)
        self.test_team.setRating(4.2)
        self.assertEqual(self.test_team.getRating(),4.2)

    def test_get_and_set_Performance(self):
        self.assertEqual(self.test_team.getPerformance(), 0.0)
        self.test_team.setPerformance(4.2)
        self.assertEqual(self.test_team.getPerformance(),4.2)

    def test_get_and_set_ScheduleFactor(self):
        self.assertEqual(self.test_team.getScheduleFactor(), 0.0)
        self.test_team.setScheduleFactor(4.2)
        self.assertEqual(self.test_team.getScheduleFactor(),4.2)

    def test_get_and_set_Wins(self):
        self.assertEqual(self.test_team.getWins(), 0)
        self.test_team.setWins(4)
        self.assertEqual(self.test_team.getWins(),4)

    def test_get_and_set_Losses(self):
        self.assertEqual(self.test_team.getLosses(), 0)
        self.test_team.setLosses(4)
        self.assertEqual(self.test_team.getLosses(),4)

    def test_get_and_set_Ties(self):
        self.assertEqual(self.test_team.getTies(), 0)
        self.test_team.setTies(4)
        self.assertEqual(self.test_team.getTies(),4)
Пример #2
0
class TestTeam(unittest.TestCase):
    def setUp(self):
        self.test_team = Team("Example Team")

    def tearDown(self):
        self.test_team = None

    def test_instatiation(self):
        self.assertEqual(self.test_team._name, "Example Team")
        self.assertEqual(self.test_team._rating, 0.0)
        self.assertEqual(self.test_team._performance, 0.0)
        self.assertEqual(self.test_team._scheduleFactor, 0.0)
        self.assertEqual(self.test_team._wins, 0)
        self.assertEqual(self.test_team._losses, 0)
        self.assertEqual(self.test_team._ties, 0)
        self.assertIsNone(self.test_team.next)

    def test_getTeam(self):
        self.assertEqual(self.test_team.getTeam(), "Example Team")

    def test_get_and_set_Rating(self):
        self.assertEqual(self.test_team.getRating(), 0.0)
        self.test_team.setRating(4.2)
        self.assertEqual(self.test_team.getRating(), 4.2)

    def test_get_and_set_Performance(self):
        self.assertEqual(self.test_team.getPerformance(), 0.0)
        self.test_team.setPerformance(4.2)
        self.assertEqual(self.test_team.getPerformance(), 4.2)

    def test_get_and_set_ScheduleFactor(self):
        self.assertEqual(self.test_team.getScheduleFactor(), 0.0)
        self.test_team.setScheduleFactor(4.2)
        self.assertEqual(self.test_team.getScheduleFactor(), 4.2)

    def test_get_and_set_Wins(self):
        self.assertEqual(self.test_team.getWins(), 0)
        self.test_team.setWins(4)
        self.assertEqual(self.test_team.getWins(), 4)

    def test_get_and_set_Losses(self):
        self.assertEqual(self.test_team.getLosses(), 0)
        self.test_team.setLosses(4)
        self.assertEqual(self.test_team.getLosses(), 4)

    def test_get_and_set_Ties(self):
        self.assertEqual(self.test_team.getTies(), 0)
        self.test_team.setTies(4)
        self.assertEqual(self.test_team.getTies(), 4)