Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tasty Pages
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SE2 Projekt
Tasty Pages
Commits
58bdbfd0
Commit
58bdbfd0
authored
1 year ago
by
Karsch Lukas
Browse files
Options
Downloads
Patches
Plain Diff
added test
parent
3749d978
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/mi/hdm/recipes/Categories.java
+2
-0
2 additions, 0 deletions
src/main/java/mi/hdm/recipes/Categories.java
src/test/java/mi/hdm/recipes/CategoryTest.java
+36
-0
36 additions, 0 deletions
src/test/java/mi/hdm/recipes/CategoryTest.java
with
38 additions
and
0 deletions
src/main/java/mi/hdm/recipes/Categories.java
+
2
−
0
View file @
58bdbfd0
...
@@ -14,6 +14,8 @@ public class Categories {
...
@@ -14,6 +14,8 @@ public class Categories {
return
allCategories
.
remove
(
c
);
return
allCategories
.
remove
(
c
);
}
}
public
void
removeCategory
(
String
name
)
{}
public
Set
<
Category
>
getAllCategories
(){
public
Set
<
Category
>
getAllCategories
(){
return
allCategories
;
return
allCategories
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/test/java/mi/hdm/recipes/CategoryTest.java
0 → 100644
+
36
−
0
View file @
58bdbfd0
package
mi.hdm.recipes
;
import
org.junit.Assert
;
import
org.junit.Before
;
import
org.junit.Test
;
import
static
org
.
junit
.
Assert
.*;
public
class
CategoryTest
{
Categories
underTest
=
new
Categories
();
@Test
public
void
testEquals
()
{
Category
c1
=
new
Category
(
"Abend"
,
0x00FF00
);
Category
c2
=
new
Category
(
"LEcker"
,
0x13
);
Category
c3
=
new
Category
(
"ew"
,
0x13
);
Category
c4
=
new
Category
(
"ew"
,
0x100
);
assertNotEquals
(
c1
,
c2
);
assertEquals
(
c3
,
c4
);
assertEquals
(
c2
,
c3
);
}
@Test
public
void
shouldNotBeAbleToAddIdenticalName
()
{
underTest
.
addCategory
(
"Mittag"
,
0x100000
);
underTest
.
addCategory
(
"Mittag"
,
0x100000
);
Assert
.
assertEquals
(
1
,
underTest
.
getAllCategories
().
size
());
}
@Test
public
void
shouldBeAbleToAddCategory
()
{
underTest
.
addCategory
(
"Morgen"
,
0x100000
);
Assert
.
assertEquals
(
2
,
underTest
.
getAllCategories
().
size
());
}
}
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