Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
ModernDev Assignment 2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marvin Serchimo
ModernDev Assignment 2
Commits
a438ac1e
Commit
a438ac1e
authored
1 week ago
by
Marvin Serchimo
Browse files
Options
Downloads
Patches
Plain Diff
Feature1
parent
81384272
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test_string_calculator.py
+34
-0
34 additions, 0 deletions
test_string_calculator.py
with
34 additions
and
0 deletions
test_string_calculator.py
0 → 100644
+
34
−
0
View file @
a438ac1e
import
unittest
from
string_calculator
import
StringCalculator
class
TestStringCalculator
(
unittest
.
TestCase
):
"""
Test suite for the StringCalculator class.
"""
def
setUp
(
self
):
"""
neue Instanz des StringCalculators vor jedem Test
"""
self
.
calculator
=
StringCalculator
()
def
test_empty_string_returns_zero
(
self
):
"""
Test: Leerer String soll 0 ergeben
"""
self
.
assertEqual
(
self
.
calculator
.
add
(
""
),
0
)
def
test_single_number_returns_value
(
self
):
"""
Test: Ein einzelner Wert soll zurückgegeben werden
"""
self
.
assertEqual
(
self
.
calculator
.
add
(
"
1
"
),
1
)
def
test_two_numbers_return_sum
(
self
):
"""
Test: Zwei Zahlen sollen summiert werden
"""
self
.
assertEqual
(
self
.
calculator
.
add
(
"
1,2
"
),
3
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment