diff options
| author | WillemDalton <willemhdalton@gmail.com> | 2025-11-14 12:27:53 -0500 |
|---|---|---|
| committer | WillemDalton <willemhdalton@gmail.com> | 2025-11-14 12:27:53 -0500 |
| commit | dd60732c456a6e0851f8b2f8e24600cc9eed77d0 (patch) | |
| tree | 91336d48722397fc895128a079fb0c910a9f21cc /src/test/java/design/model/GolferTest.java | |
| parent | cf3db9a7e13f7e919381cd2c8555ee31e3d50cf0 (diff) | |
| download | designproject-design-6-dd60732c456a6e0851f8b2f8e24600cc9eed77d0.tar.gz designproject-design-6-dd60732c456a6e0851f8b2f8e24600cc9eed77d0.tar.bz2 designproject-design-6-dd60732c456a6e0851f8b2f8e24600cc9eed77d0.zip | |
finished unit testing for teams and matches
Diffstat (limited to 'src/test/java/design/model/GolferTest.java')
| -rw-r--r-- | src/test/java/design/model/GolferTest.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/java/design/model/GolferTest.java b/src/test/java/design/model/GolferTest.java index 65229f3..5f113ab 100644 --- a/src/test/java/design/model/GolferTest.java +++ b/src/test/java/design/model/GolferTest.java @@ -10,6 +10,7 @@ import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; import design.model.Club.ClubType; +import design.model.undo.Memento; import java.lang.reflect.Constructor; import java.time.LocalDateTime; @@ -137,6 +138,16 @@ public class GolferTest { assertEquals(expectedString, testGolfer.toString()); } + @Test + void testMemento() + { + Golfer testGolfer = new Golfer("John Doe", "jdoesgolf2", "weback4321"); + Memento memento = testGolfer.createMemento(); + testGolfer.setFullName("Joe Doe"); + assertEquals("Joe Doe", testGolfer.getFullName()); + testGolfer.restore(memento); + assertEquals("John Doe", testGolfer.getFullName()); + } } |
