示例#1
0
 def test_happy_number(self):
     solution = Solution()
     self.assertEqual(solution.isHappy(1), True)
     self.assertEqual(solution.isHappy(11), False)
     self.assertEqual(solution.isHappy(12), False)
     self.assertEqual(solution.isHappy(19), True)
     self.assertEqual(solution.isHappy(100), True)
示例#2
0
    def test_isHappy(self):
        """
        given: 19
        return: True
        """
        num = 19
        expected = True

        sol = Solution()
        result = sol.isHappy(num)
        self.assertIs(result, expected)