Skip to content

Commit 76f5ed4

Browse files
ulleniusJohannestegner
authored andcommitted
Add test for toString method
1 parent 43e6064 commit 76f5ed4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/test/java/PersonnummerEqualsHashcode.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,12 @@ void testHashCode() throws PersonnummerException {
3131
assertNotEquals(young2, other);
3232
}
3333

34+
@Test
35+
void testToString() throws PersonnummerException {
36+
37+
Personnummer young = new Personnummer("201701022384");
38+
assertEquals("170102-2384", young.toString());
39+
assertEquals(young.format(), young.toString());
40+
}
41+
3442
}

0 commit comments

Comments
 (0)