Пример #1
0
 def test_scoreLetter(self):
     scorer = NameScorer()
     self.assertEqual(1, scorer.scoreLetter("A"))
     self.assertEqual(26, scorer.scoreLetter("Z"))
Пример #2
0
    def test_scoreFile(self):
        filePath = "data/names.txt"
        expectedScore = 871198282

        scorer = NameScorer()
        self.assertEqual(expectedScore, scorer.scoreFile(filePath))
Пример #3
0
    def test_scoreName_hannah(self):
        name = "hannah"
        expectedScore = 8 + 1 + 14 + 14 + 1 + 8

        scorer = NameScorer()
        self.assertEqual(expectedScore, scorer.scoreName(name))
Пример #4
0
    def test_scoreList(self):
        names = ["kyle", "hannah"]
        expectedScore = (46 * 1) + (53 * 2)

        scorer = NameScorer()
        self.assertEqual(expectedScore, scorer.scoreList(names))
Пример #5
0
    def test_scoreName_kyle(self):
        name = "kyle"
        expectedScore = 11 + 25 + 12 + 5

        scorer = NameScorer()
        self.assertEqual(expectedScore, scorer.scoreName(name))