Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CardGame
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Matteus Rødøy Mitei
CardGame
Commits
f4db1003
Commit
f4db1003
authored
10 months ago
by
Matteus Rødøy Mitei
Browse files
Options
Downloads
Patches
Plain Diff
Shorten and improve Hand-test
parent
52530d7c
No related branches found
No related tags found
No related merge requests found
Pipeline
#265494
passed with stages
in 1 minute and 16 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/test/java/edu/ntnu/stud/HandTest.java
+6
-9
6 additions, 9 deletions
src/test/java/edu/ntnu/stud/HandTest.java
with
6 additions
and
9 deletions
src/test/java/edu/ntnu/stud/HandTest.java
+
6
−
9
View file @
f4db1003
...
...
@@ -3,9 +3,6 @@ package edu.ntnu.stud;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.Test
;
import
java.util.HashSet
;
import
java.util.Set
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.*;
class
HandTest
{
...
...
@@ -20,7 +17,7 @@ class HandTest {
void
addCard
()
{
PlayingCard
card
=
new
PlayingCard
(
'H'
,
5
);
hand
.
addCard
(
card
);
assert
True
(
hand
.
size
()
==
1
);
assert
Equals
(
1
,
hand
.
size
());
assertTrue
(
hand
.
toString
().
contains
(
card
.
getAsString
()));
}
...
...
@@ -29,18 +26,18 @@ class HandTest {
PlayingCard
card
=
new
PlayingCard
(
'H'
,
5
);
hand
.
addCard
(
card
);
hand
.
clear
();
assert
True
(
hand
.
size
()
==
0
);
assert
Equals
(
0
,
hand
.
size
());
assertTrue
(
hand
.
toString
().
isEmpty
());
}
@Test
void
size
()
{
assert
True
(
hand
.
size
()
==
0
);
assert
Equals
(
0
,
hand
.
size
());
PlayingCard
card1
=
new
PlayingCard
(
'H'
,
5
);
PlayingCard
card2
=
new
PlayingCard
(
'D'
,
8
);
hand
.
addCard
(
card1
);
hand
.
addCard
(
card2
);
assert
True
(
hand
.
size
()
==
2
);
assert
Equals
(
2
,
hand
.
size
());
}
@Test
...
...
@@ -70,7 +67,7 @@ class HandTest {
hand
.
addCard
(
new
PlayingCard
(
'C'
,
4
));
hand
.
addCard
(
new
PlayingCard
(
'S'
,
5
));
hand
.
addCard
(
new
PlayingCard
(
'H'
,
6
));
assert
True
(
hand
.
sumOfFaces
()
==
(
2
+
3
+
4
+
5
+
6
));
assert
Equals
((
2
+
3
+
4
+
5
+
6
),
hand
.
sumOfFaces
(
));
}
@Test
...
...
@@ -80,7 +77,7 @@ class HandTest {
hand
.
addCard
(
new
PlayingCard
(
'C'
,
4
));
hand
.
addCard
(
new
PlayingCard
(
'S'
,
5
));
hand
.
addCard
(
new
PlayingCard
(
'H'
,
6
));
assert
True
(
hand
.
heartsAsString
()
.
equals
(
"H2 H6"
)
);
assert
Equals
(
"H2 H6"
,
hand
.
heartsAsString
());
}
@Test
...
...
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