diff --git a/Source/Bogus.Tests/ExtensionTests/SwedishExtensionTest.cs b/Source/Bogus.Tests/ExtensionTests/SwedishExtensionTest.cs index e5ac2e97..38166c07 100644 --- a/Source/Bogus.Tests/ExtensionTests/SwedishExtensionTest.cs +++ b/Source/Bogus.Tests/ExtensionTests/SwedishExtensionTest.cs @@ -60,7 +60,7 @@ public void samordningsnummer_should_contain_offset_date_of_birth() [Theory] [InlineData(false)] [InlineData(true)] - public void when_person_is_male_second_last_number_is_even(bool isSamordningsnummer) + public void when_person_is_male_second_last_number_is_odd(bool isSamordningsnummer) { var f = new Faker("sv"); var person = f.Person; @@ -71,7 +71,7 @@ public void when_person_is_male_second_last_number_is_even(bool isSamordningsnum var secondLast = int.Parse(identificationNumber.Substring(identificationNumber.Length - 2, 1)); secondLast.Should() - .Match(x => x % 2 == 0) + .Match(x => x % 2 == 1) .And.BeLessThan(10) .And.BeGreaterThan(0); } @@ -79,7 +79,7 @@ public void when_person_is_male_second_last_number_is_even(bool isSamordningsnum [Theory] [InlineData(false)] [InlineData(true)] - public void when_person_is_female_second_last_number_is_odd(bool isSamordningsnummer) + public void when_person_is_female_second_last_number_is_even(bool isSamordningsnummer) { var f = new Faker("sv"); var person = f.Person; @@ -90,7 +90,7 @@ public void when_person_is_female_second_last_number_is_odd(bool isSamordningsnu var secondLast = int.Parse(identificationNumber.Substring(identificationNumber.Length - 2, 1)); secondLast.Should() - .Match(x => x % 2 == 1) + .Match(x => x % 2 == 0) .And.BeLessThan(10) .And.BeGreaterThan(0); } diff --git a/Source/Bogus/Extensions/Sweden/ExtensionsForSweden.cs b/Source/Bogus/Extensions/Sweden/ExtensionsForSweden.cs index 9134cdf7..7da12d2c 100644 --- a/Source/Bogus/Extensions/Sweden/ExtensionsForSweden.cs +++ b/Source/Bogus/Extensions/Sweden/ExtensionsForSweden.cs @@ -48,7 +48,7 @@ public static string Personnummer(this Person person) /// /// /// Coordination numbers enable Swedish public authorities and other organizations with a public function - /// to identify people who are not currently – and have never been – registered at an address in Sweden. + /// to identify people who are not currently – and have never been – registered at an address in Sweden. /// public static string Samordningsnummer(this Person person) { @@ -90,9 +90,9 @@ private static string GenerateIndividualNumber(Randomizer r, Gender gender, Date private static int GetGenderNumber(Randomizer r, Gender gender) { if( gender is Gender.Male ) - return r.Even(1, 9); - if( gender is Gender.Female ) return r.Odd(1, 9); + if( gender is Gender.Female ) + return r.Even(1, 9); throw new ArgumentOutOfRangeException(nameof(gender), gender, "Gender not handled."); }