Skip to content
Snippets Groups Projects
Commit bec4d441 authored by Lasse Pikkemaat's avatar Lasse Pikkemaat
Browse files

Merge branch 'Orlandos' into 'develop'

Integration von Orlandos Code + Tests

See merge request !8
parents 88f9cba0 9dee85d9
No related branches found
No related tags found
2 merge requests!15Develop,!8Integration von Orlandos Code + Tests
| Name | Interface break | Failed Testcases |
|---------|-----------------|-------------------------------------------------------------------------------------------------------------------------------|
| Orlando | no | test_add_multiple_negative_numbers (test_stringclaculator.TestStringCalculator) ... negatives not allowed: -10, -20, -30 FAIL |
| Orlando | no | test_add_single_negative_number (test_stringclaculator.TestStringCalculator) ... negatives not allowed: -2 FAIL |
\ No newline at end of file
from src.interfaces import IStringCalculator
import re
class StringCalculator(IStringCalculator):
def add(self, numbers: str) -> int:
if not numbers:
......@@ -33,4 +32,4 @@ class StringCalculator(IStringCalculator):
numbers_list = [num for num in numbers_list if num <= 1000]
return sum(numbers_list)
\ No newline at end of file
return sum(numbers_list)
......@@ -23,10 +23,14 @@
# Bei Eingabe von //[**]\n1**2**3 soll 6 ausgegeben werden
# Bei Eingabe von //[###]\n10###20###30 soll 60 ausgegeben werden
'''
import unittest
from src.interfaces import IStringCalculator
from src.stringcalculator import StringCalculator
'''
import unittest
from others.Orlando.OrlandoInterfaces import IStringCalculator
from others.Orlando.OrlandoStringCalculator import StringCalculator
class TestStringCalculator(unittest.TestCase):
def setUp(self):
......@@ -81,5 +85,5 @@ class TestStringCalculator(unittest.TestCase):
if __name__ == "__main__":
unittest.main()
# python -m unittest tests.test_stringcalculator
# python -m unittest tests.testStringcalculator -v
# python -m unittest discover -s tests -v
\ No newline at end of file
| Name | Interface break | Failed Testcases | Comment |
|---------|-----------------|--------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Orlando | no | test_add_ignores_empty_entries (testsOthers.testsOrlando.OrlandoTestStringCalculator.TestStringCalculator) ... ERROR | Mit numbers.split(",") wird eine Liste mit leeren Strings wobei diese dann nicht in integer umgewandelt werden können. Lösungsansatz: Vor der Umwandlung leere Strings enfernen |
| Orlando | no | test_add_raises_exception_on_multiple_negatives (testsOthers.testsOrlando.OrlandoTestStringCalculator.TestStringCalculator) ... FAIL | |
| Orlando | no | test_add_raises_exception_on_negative_number (testsOthers.testsOrlando.OrlandoTestStringCalculator.TestStringCalculator) ... FAIL | |
\ 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