Skip to content

Commit

Permalink
fix(test): Fixed an issue where coordination number test would fail d…
Browse files Browse the repository at this point in the history
…ue to 'expectaton' being wrongly parsed on int to string (no 00 format).

Signed-off-by: Johannes Tegnér <[email protected]>
  • Loading branch information
Johannestegner committed Mar 11, 2023
1 parent ad5ab09 commit f525bcd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Personnummer.Tests/PersonnummerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ public void TestDateCn(PersonnummerData data)
{
var expect = data.LongFormat[..4];
expect += data.LongFormat.Substring(4, 2);
expect += (int.Parse(data.LongFormat.Substring(6, 2)) - 60).ToString();
expect += (int.Parse(data.LongFormat.Substring(6, 2)) - 60).ToString("00");

var pn = new Personnummer(data.LongFormat);
Assert.Equal(expect, $"{pn.Date.Year:0000}{pn.Date.Month:00}{pn.Date.Day:00}");
Expand Down

0 comments on commit f525bcd

Please sign in to comment.