Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cs0a-24su
war
Commits
b7cc3a7a
Commit
b7cc3a7a
authored
1 year ago
by
Vansh V. Tibrewal
Browse files
Options
Download
Email Patches
Plain Diff
Expected, Actual order resolved in CardTests
parent
759bf4b6
master
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/edu/caltech/cs0/war/CardTests.java
+3
-3
tests/edu/caltech/cs0/war/CardTests.java
with
3 additions
and
3 deletions
+3
-3
tests/edu/caltech/cs0/war/CardTests.java
View file @
b7cc3a7a
...
@@ -75,14 +75,14 @@ public class CardTests {
...
@@ -75,14 +75,14 @@ public class CardTests {
@ParameterizedTest
(
name
=
"ties() correctly determines if {0} of {1} ties {2} of {3}"
)
@ParameterizedTest
(
name
=
"ties() correctly determines if {0} of {1} ties {2} of {3}"
)
@CsvFileSource
(
files
=
"tests/data/ties.txt"
)
@CsvFileSource
(
files
=
"tests/data/ties.txt"
)
public
void
testTies
(
Rank
r1
,
Suit
s1
,
Rank
r2
,
Suit
s2
,
boolean
answer
)
{
public
void
testTies
(
Rank
r1
,
Suit
s1
,
Rank
r2
,
Suit
s2
,
boolean
answer
)
{
assertEquals
(
new
Card
(
r1
,
s1
).
ties
(
new
Card
(
r2
,
s2
))
,
answer
);
assertEquals
(
answer
,
new
Card
(
r1
,
s1
).
ties
(
new
Card
(
r2
,
s2
)));
}
}
@DisplayName
(
"beats() works correctly"
)
@DisplayName
(
"beats() works correctly"
)
@ParameterizedTest
(
name
=
"beats() correctly determines if {0} of {1} beats {2} of {3}"
)
@ParameterizedTest
(
name
=
"beats() correctly determines if {0} of {1} beats {2} of {3}"
)
@CsvFileSource
(
files
=
"tests/data/beats.txt"
)
@CsvFileSource
(
files
=
"tests/data/beats.txt"
)
public
void
testBeats
(
Rank
r1
,
Suit
s1
,
Rank
r2
,
Suit
s2
,
boolean
answer
)
{
public
void
testBeats
(
Rank
r1
,
Suit
s1
,
Rank
r2
,
Suit
s2
,
boolean
answer
)
{
assertEquals
(
new
Card
(
r1
,
s1
).
beats
(
new
Card
(
r2
,
s2
))
,
answer
);
assertEquals
(
answer
,
new
Card
(
r1
,
s1
).
beats
(
new
Card
(
r2
,
s2
)));
}
}
@DisplayName
(
"rankToString() works correctly"
)
@DisplayName
(
"rankToString() works correctly"
)
...
@@ -91,7 +91,7 @@ public class CardTests {
...
@@ -91,7 +91,7 @@ public class CardTests {
public
void
testRankToString
(
Rank
r
,
Suit
s
,
String
answer
)
{
public
void
testRankToString
(
Rank
r
,
Suit
s
,
String
answer
)
{
var
meth
=
Reflection
.
getMethod
(
Card
.
class
,
"rankToString"
);
var
meth
=
Reflection
.
getMethod
(
Card
.
class
,
"rankToString"
);
var
result
=
Reflection
.
invoke
(
meth
,
new
Card
(
r
,
s
));
var
result
=
Reflection
.
invoke
(
meth
,
new
Card
(
r
,
s
));
assertEquals
(
result
,
answer
);
assertEquals
(
answer
,
result
);
}
}
}
}
}
}
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help