Commit b7cc3a7a authored by Vansh V. Tibrewal's avatar Vansh V. Tibrewal
Browse files

Expected, Actual order resolved in CardTests

parent 759bf4b6
No related merge requests found
Showing with 3 additions and 3 deletions
+3 -3
...@@ -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);
} }
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment