Skip to content

Commit

Permalink
Add Kosovo postal code too.
Browse files Browse the repository at this point in the history
  • Loading branch information
Corniel committed Aug 8, 2018
1 parent 6597df1 commit d030ac8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
3 changes: 3 additions & 0 deletions src/Qowaiv/Globalization/PostalCodeCountryInfoInstances.cs
Expand Up @@ -514,6 +514,9 @@ public partial class PostalCodeCountryInfo
// WF: Wallis And Futuna, http://en.wikipedia.org/wiki/List_of_postal_codes_in_France
{ Country.WF, New(Country.WF,@"^986[0-9]{2}$") },

// XK: Kosovo, https://en.wikipedia.org/wiki/Postal_codes_in_Kosovo
{ Country.XK, New(Country.XK,@"^[1-7][0-9]{4}$") },

// YT: Mayotte, http://en.wikipedia.org/wiki/List_of_postal_codes_in_France
{ Country.YT, New(Country.YT,@"^976[0-9]{2}$") },

Expand Down
12 changes: 6 additions & 6 deletions test/Qowaiv.UnitTests/Globalization/CountryTest.cs
Expand Up @@ -24,15 +24,15 @@ public void Empty_None_EqualsDefault()
}

[Test]
public void All_None_259Countries()
public void All_None_260Countries()
{
Assert.AreEqual(259, Country.All.Count);
Assert.AreEqual(260, Country.All.Count);
}

[Test]
public void GetExisting_Januari2016_249Countries()
public void GetExisting_Januari2016_250Countries()
{
Assert.AreEqual(249, Country.GetExisting(new Date(2016, 01, 01)).Count());
Assert.AreEqual(250, Country.GetExisting(new Date(2016, 01, 01)).Count());
}


Expand Down Expand Up @@ -1175,9 +1175,9 @@ public void GetCurrent_1973_0()
}

[Test]
public void GetCurrent_None_249()
public void GetCurrent_None_250()
{
var exp = 249;
var exp = 250;
var act = Country.GetExisting().ToList();

Assert.AreEqual(exp, act.Count);
Expand Down
9 changes: 8 additions & 1 deletion test/Qowaiv.UnitTests/PostalCodeCountryPatternTest.cs
Expand Up @@ -1160,7 +1160,7 @@ public void IsNotValid_VE_All()
// Not possible to generate.
// IsNotValid(Country.VE, true, false, 4, 5);
}

/// <summary>Tests patterns that should not be valid for Virgin Islands (VG).</summary>
[Test]
public void IsNotValid_VG_All()
Expand Down Expand Up @@ -1189,6 +1189,13 @@ public void IsNotValid_WF_All()
IsNotValid(Country.WF, false, false, 5);
}

/// <summary>Tests patterns that should not be valid for Kosovo (XK).</summary>
[Test]
public void IsNotValid_XK_All()
{
IsNotValid(Country.XK, false, false, 5);
}

/// <summary>Tests patterns that should not be valid for Mayotte (YT).</summary>
[Test]
public void IsNotValid_YT_All()
Expand Down
Binary file modified tooling/Qowaiv.CodeGenerator/Resources/PostalCode.xls
Binary file not shown.

0 comments on commit d030ac8

Please sign in to comment.