diff --git a/others/Orlando/reportOrlandosImp.md b/others/Orlando/reportOrlandosImp.md new file mode 100644 index 0000000000000000000000000000000000000000..504a41a8fe7d6264ad8191c51288ef3c9fb9d025 --- /dev/null +++ b/others/Orlando/reportOrlandosImp.md @@ -0,0 +1,4 @@ +| 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 diff --git a/src/stringcalculator.py b/src/stringcalculator.py index fc7e89a3c15a18957c55241afea7767fcad48f34..f48f2e8c85d9b1acc3b6bd36299155789d269fa1 100644 --- a/src/stringcalculator.py +++ b/src/stringcalculator.py @@ -1,7 +1,6 @@ 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) diff --git a/tests/test_stringclaculator.py b/tests/testStringcalculator.py similarity index 94% rename from tests/test_stringclaculator.py rename to tests/testStringcalculator.py index e2e765bd59b8d7d50121700aa53d98082b57a32f..718074c4fd68c2eed352909c674200bec6964548 100644 --- a/tests/test_stringclaculator.py +++ b/tests/testStringcalculator.py @@ -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 diff --git a/testsOthers/testsOrlando/reportOrlandosTests.md b/testsOthers/testsOrlando/reportOrlandosTests.md new file mode 100644 index 0000000000000000000000000000000000000000..a94c9501558ed94066dd150ff207521b2b73dda6 --- /dev/null +++ b/testsOthers/testsOrlando/reportOrlandosTests.md @@ -0,0 +1,5 @@ +| 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