Skip to content
Snippets Groups Projects
Commit 89a73fe9 authored by Daniel Rafeh's avatar Daniel Rafeh
Browse files

test successful but function maybe useless

parent a05d799f
No related branches found
No related tags found
No related merge requests found
Pipeline #20019 passed
......@@ -28,6 +28,10 @@ class StringCalculator(IStringCalculator):
'''Zahlen mit Kommas werden aufgeteilt'''
list = numbers.split(",")
'''Nur 2 Werte sollen miteinander multipliziert werden'''
if len(list)>2:
return "only two numbers allowed"
'''Konvertirung von Strings zu Integer'''
result = 0
for num in list:
......@@ -56,5 +60,9 @@ class TestStringCalculator(unittest.TestCase):
res = self.c.add("0,5")
self.assertEqual(res, 5)
def test_addingThreeNumbers(self):
res = self.c.add("1,2,3")
self.assertEqual(res, "only two numbers allowed")
if __name__ == "__main__":
unittest.main()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment