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

Test successful

parent 89a73fe9
No related branches found
No related tags found
No related merge requests found
Pipeline #20021 passed
......@@ -31,6 +31,10 @@ class StringCalculator(IStringCalculator):
'''Nur 2 Werte sollen miteinander multipliziert werden'''
if len(list)>2:
return "only two numbers allowed"
for num in list:
if "." in num:
return "only integers allowed"
'''Konvertirung von Strings zu Integer'''
result = 0
......@@ -64,5 +68,9 @@ class TestStringCalculator(unittest.TestCase):
res = self.c.add("1,2,3")
self.assertEqual(res, "only two numbers allowed")
def test_handleFloat(self):
res = self.c.add("3.5")
self.assertEqual(res, "only integers 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