diff options
Diffstat (limited to '')
| -rw-r--r-- | src/test/java/design/model/GolferTest.java | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/test/java/design/model/GolferTest.java b/src/test/java/design/model/GolferTest.java index 52e6271..65229f3 100644 --- a/src/test/java/design/model/GolferTest.java +++ b/src/test/java/design/model/GolferTest.java @@ -33,7 +33,7 @@ public class GolferTest { } @Test - void testPrivateConstructor() throws Exception + void testPrivateConstructor() throws Exception { Constructor<Golfer> constructor = Golfer.class.getDeclaredConstructor(String.class, int.class, String.class, List.class, List.class, List.class); assertTrue(Modifier.isPrivate(constructor.getModifiers())); @@ -107,7 +107,9 @@ public class GolferTest { void testAddClub() { Golfer testGolfer = new Golfer("John Doe", "jdoesgolf2", "weback4321"); - testGolfer.addClub("John Doe", "The Slammer", ClubType.DRIVER); + + Club c = new Club("John Doe", "The Slammer", ClubType.DRIVER); + testGolfer.addClub(c); Club addedClub = testGolfer.getClubs()[0]; assertTrue(testGolfer.hasClub(addedClub)); assertTrue(testGolfer.hasClubs()); @@ -117,7 +119,9 @@ public class GolferTest { void testRemoveClub() { Golfer testGolfer = new Golfer("John Doe", "jdoesgolf2", "weback4321"); - testGolfer.addClub("John Doe", "The Slammer", ClubType.DRIVER); + + Club c = new Club("John Doe", "The Slammer", ClubType.DRIVER); + testGolfer.addClub(c); Club addedClub = testGolfer.getClubs()[0]; testGolfer.removeClub(addedClub); assertFalse(testGolfer.hasClub(addedClub)); @@ -132,4 +136,8 @@ public class GolferTest { String expectedString = "John Doe (@jdoesgolf2)"; assertEquals(expectedString, testGolfer.toString()); } -}
\ No newline at end of file + + + +} + |
