Skip to content

Commit

Permalink
Add test for toString method
Browse files Browse the repository at this point in the history
  • Loading branch information
ullenius authored and Johannestegner committed Jun 26, 2020
1 parent 43e6064 commit 76f5ed4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/test/java/PersonnummerEqualsHashcode.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,12 @@ void testHashCode() throws PersonnummerException {
assertNotEquals(young2, other);
}

@Test
void testToString() throws PersonnummerException {

Personnummer young = new Personnummer("201701022384");
assertEquals("170102-2384", young.toString());
assertEquals(young.format(), young.toString());
}

}

0 comments on commit 76f5ed4

Please sign in to comment.