def test_sum_of_digits(self):
     self.assertEqual(43, sum_of_digits(1325132435356))
     self.assertEqual(1 + 2 + 3, sum_of_digits(123))
     self.assertEqual(6, sum_of_digits(6))
     self.assertEqual(1, sum_of_digits(-10))
     self.assertEqual(0, sum_of_digits(0))
     self.assertEqual(4 + 3 + 5, sum_of_digits(400003005))
 def test_sum_of_digits(self):
     self.assertEqual(43, solution.sum_of_digits(1325132435356))
     self.assertEqual(6, solution.sum_of_digits(123))
     self.assertEqual(6, solution.sum_of_digits(6))
     self.assertEqual(1, solution.sum_of_digits(-10))
Beispiel #3
0
	def test_big_number(self):
		self.assertEqual(43,sum_of_digits(1325132435356))
Beispiel #4
0
 def test_sum_digits_of_1325132435356(self):
     self.assertEqual(1 + 3 + 2 + 5 + 1 + 3 + 2 + 4 + 3 + 5 + 3 + 5 + 6,
                      sum_of_digits(1325132435356))
Beispiel #5
0
	def test_1(self):
		self.assertEqual(43, sum_of_digits(1325132435356))
Beispiel #6
0
 def test_sum_of_digits_1(self):
     self.assertEqual(10, sum_of_digits(37))
Beispiel #7
0
 def test_one(self):
     self.assertEqual(solution.sum_of_digits(1325132435356), 43)
Beispiel #8
0
	def test_negative_number(self):
		self.assertEqual(1, sum_of_digits(-10))
Beispiel #9
0
 def test_with_numbers_with_even_number_of_digits(self):
     self.assertEqual(solution.sum_of_digits(123456), 21)
     self.assertEqual(solution.sum_of_digits(89068113), 36)
Beispiel #10
0
 def test_with_one_digit_numbers(self):
     self.assertEqual(solution.sum_of_digits(0), 0)
     self.assertTrue(solution.sum_of_digits(5), 5)
Beispiel #11
0
 def test_with_positive_numbers(self):
     self.assertEqual(solution.sum_of_digits(42), 6)
     self.assertEqual(solution.sum_of_digits(678732), 33)
 def test_fibonacci_79810(self):
     self.assertEqual(25, solution.sum_of_digits(79810))
Beispiel #13
0
 def test_sum_of_digits_2(self):
     self.assertEqual(6, solution.sum_of_digits(123))
Beispiel #14
0
 def test_sum_of_digits_1(self):
     self.assertEqual(43, solution.sum_of_digits(1325132435356))
Beispiel #15
0
 def test_sum_of_digits_4(self):
     self.assertEqual(1, solution.sum_of_digits(-10))
	def test_sum_of_digits_1234(self):
		self.assertEqual(10, solution.sum_of_digits(1234))
	def test_sum_of_digits_0(self):
		self.assertEqual(0, solution.sum_of_digits(0))
Beispiel #18
0
 def test_with_numbers_with_odd_number_of_digits(self):
     self.assertEqual(solution.sum_of_digits(123456789), 45)
     self.assertEqual(solution.sum_of_digits(90000000011), 11)
Beispiel #19
0
 def test_three(self):
     self.assertEqual(solution.sum_of_digits(6), 6)
Beispiel #20
0
 def test_with_negative_numbers(self):
     self.assertEqual(solution.sum_of_digits(-101), 2)
     self.assertEqual(solution.sum_of_digits(-10000), 1)
 def test_sum_of_digits(self):
     self.assertEqual(43, sum_of_digits(1325132435356))
     self.assertEqual(6, sum_of_digits(123))
     self.assertEqual(6, sum_of_digits(6))
     self.assertEqual(1, sum_of_digits(-10))
Beispiel #22
0
 def test_problem_statement_cases(self):
     self.assertEqual(43, sum_of_digits(1325132435356))
     self.assertEqual(6, sum_of_digits(123))
     self.assertEqual(6, sum_of_digits(6))
     self.assertEqual(1, sum_of_digits(-10))
     self.assertEqual(0, sum_of_digits(0))
Beispiel #23
0
	def test_4(self):
		self.assertEqual(1, sum_of_digits(-10))
Beispiel #24
0
 def test_tree(self):
     self.assertEqual(6, sum_of_digits(6))
Beispiel #25
0
 def test_sum_of_digits_3(self):
     self.assertEqual(6, solution.sum_of_digits(6))
Beispiel #26
0
 def test_four(self):
     self.assertEqual(1, sum_of_digits(-10))
Beispiel #27
0
 def test_one(self):
     self.assertEqual(43, sum_of_digits(1325132435356))
Beispiel #28
0
 def test_two(self):
     self.assertEqual(6, sum_of_digits(123))
Beispiel #29
0
 def test_sum_of_digits(self):
     self.assertEqual(10, solution.sum_of_digits(1234))
     self.assertEqual(36, solution.sum_of_digits(9999))
	def test_sum_of_digits_4(self):
		self.assertEqual(1, solution.sum_of_digits(-10))
	def test_sum_of_digits_123(self):
		self.assertEqual(6, solution.sum_of_digits(123))
	def test_sum_of_digits_1(self):
		self.assertEqual(43, solution.sum_of_digits(1325132435356))
	def test_sum_of_digits_negative_564(self):
		self.assertEqual(15, solution.sum_of_digits(-564))
 def test_fibonacci_1000000(self):
     self.assertEqual(1, solution.sum_of_digits(1000000))
	def test_sum_of_digits_1(self):
		self.assertEqual(1, solution.sum_of_digits(1))
 def test_fibonacci_377(self):
     self.assertEqual(17, solution.sum_of_digits(377))
Beispiel #37
0
 def test_solution(self):
     self.assertEqual(2.5,sum_of_digits(5/2))
     self.assertEqual(2,sum_of_digits(5//2))
 def test_fibonacci_354224848179261915075(self):
     self.assertEqual(111, solution.sum_of_digits(3542248485599278518291))
Beispiel #39
0
 def test_four(self):
     self.assertEqual(solution.sum_of_digits(-10), 1)
 def test_fibonacci_123(self):
     self.assertEqual(6, solution.sum_of_digits(-123))
Beispiel #41
0
 def test_two(self):
     self.assertEqual(solution.sum_of_digits(123), 6)
 def test_fibonacci_79810(self):
     self.assertEqual(25, solution.sum_of_digits(79810))
Beispiel #43
0
 def test_sum_of_digits_2(self):
     self.assertEqual(37, sum_of_digits(203040105005050505))
Beispiel #44
0
 def test_sum_digits_of_123(self):
     self.assertEqual(1 + 2 + 3, sum_of_digits(123))
Beispiel #45
0
	def test_3(self):
		self.assertEqual(6, sum_of_digits(6))
Beispiel #46
0
 def test_sum_digits_of_6(self):
     self.assertEqual(6, sum_of_digits(6))
Beispiel #47
0
	def test_5(self):
		self.assertEqual(10, sum_of_digits(-1234))
Beispiel #48
0
 def test_sum_digits_of_minus_10(self):
     self.assertEqual(1, sum_of_digits(-10))
Beispiel #49
0
	def test_2(self):
		self.assertEqual(6, sum_of_digits(123))
Beispiel #50
0
 def test_negative(self):
     self.assertEqual(1, solution.sum_of_digits(-10))