Skip to content

Commit

Permalink
updated to version 1.1.10.2 (#15)
Browse files Browse the repository at this point in the history
* removed useless yaml file

* updated package with license

* removed unneeded lib folder and updated package to newest IgnActivation

* updated to latest IGNActivation client

* Update README.md

* updated to latest ignactivationclient
updated project url in package

* added some more vat validations and updated activation client

* updated version number of package

* updated ignactivator client

* added icon

* minor optimization of code and unittests

* updated activator package to reoptimise unittests to stop fails from failed activation

* updated with latest version of IGNActivator

* Update README.md

* moved to new activation client

* updated to fixed version of activator

* updated activator to fix build problems

* attempt to fix build errors

* attempt to fix unittests and build for validator by switching to offline activation

* fixed incorrect build

* moved to use of new activation client and updated version of .net core

* added nunit console runner packages

* updated to latest ignactivator

* corrected ierland vat number
removed some unneeded methods
reused same files for netcore and netfx tests
added tests for Ierland and Italy

* try to fix unittests on azure

* another fix for unittests

* removed some unneeded nuget packages for tests

* fixed unittest problem

* fixed spain vat format rules

* added unittests for LT LV vat numbers
  • Loading branch information
OlegGolovchenko committed Aug 17, 2022
1 parent 0bff831 commit 9cfb11b
Show file tree
Hide file tree
Showing 12 changed files with 166 additions and 509 deletions.
Binary file added IGNKeyGenWin.dll
Binary file not shown.
Binary file added libIGNKeyGenLin.so
Binary file not shown.
114 changes: 112 additions & 2 deletions org.igrok.validator.test.netcore/VatTest.cs
Expand Up @@ -14,8 +14,8 @@ public void SetupTestRuns()
VatValidator.Activate("igntest@igrok-net.org", "02317-7C8A2-98981-00007-DB1B8");
}

[TestCase(null)]
[TestCase("")]
[TestCase(null, TestName = "WhenVatNumberIsNull")]
[TestCase("", TestName = "WhenVatNumberIsEmpty")]
public void WhenVatNumberIsNullOrEmpty(string vat)
{
Assert.Throws<ArgumentException>(() => VatValidator.ValidateVatAsync(vat));
Expand Down Expand Up @@ -347,5 +347,115 @@ public void WhenHungarianVatIsCorrect()
{
Assert.DoesNotThrow(() => VatValidator.ValidateVatAsync("HU12345678"));
}

[Test]
public void WhenIerlandVatIsCorrect()
{
Assert.DoesNotThrow(() => VatValidator.ValidateVatAsync("IE01234567A"));
Assert.DoesNotThrow(() => VatValidator.ValidateVatAsync("IE0123456AA"));
Assert.DoesNotThrow(() => VatValidator.ValidateVatAsync("IE0A234567A"));
Assert.DoesNotThrow(() => VatValidator.ValidateVatAsync("IE0123456A"));
Assert.DoesNotThrow(() => VatValidator.ValidateVatAsync("IE012345AA"));
Assert.DoesNotThrow(() => VatValidator.ValidateVatAsync("IE0A23456A"));
}

[Test]
public void WhenIerlandVatIsNotCorrect()
{
Assert.Throws<ArgumentException>(() => VatValidator.ValidateVatAsync("IE01A34567A"));
Assert.Throws<ArgumentException>(() => VatValidator.ValidateVatAsync("IE01A3456AA"));
Assert.Throws<ArgumentException>(() => VatValidator.ValidateVatAsync("IE0AA34567A"));
Assert.Throws<ArgumentException>(() => VatValidator.ValidateVatAsync("IE01A3456A"));
Assert.Throws<ArgumentException>(() => VatValidator.ValidateVatAsync("IE01A345AA"));
Assert.Throws<ArgumentException>(() => VatValidator.ValidateVatAsync("IE0AA3456A"));
}

[Test]
public void WhenIerlandVatIsTooLong()
{
Assert.Throws<ArgumentException>(() => VatValidator.ValidateVatAsync("IE0AA3456A222"));
}

[Test]
public void WhenIerlandVatIsTooShort()
{
Assert.Throws<ArgumentException>(() => VatValidator.ValidateVatAsync("IE0AA56A"));
}

[Test]
public void WhenItalianVatIsNumeric()
{
Assert.DoesNotThrow(() => VatValidator.ValidateVatAsync("IT01234567890"));
}

[Test]
public void WhenItalianVatIsAlphanumericNumeric()
{
Assert.Throws<ArgumentException>(() => VatValidator.ValidateVatAsync("IT0123456789A"));
}

[Test]
public void WhenItalianVatIsTooLong()
{
Assert.Throws<ArgumentException>(() => VatValidator.ValidateVatAsync("IT01234567890000"));
}

[Test]
public void WhenItalianVatIsTooShort()
{
Assert.Throws<ArgumentException>(() => VatValidator.ValidateVatAsync("IT0123456789"));
}

[Test]
public void WhenLVVatIsNumeric()
{
Assert.DoesNotThrow(() => VatValidator.ValidateVatAsync("LV01234567890"));
}

[Test]
public void WhenLVVatIsAlphanumericNumeric()
{
Assert.Throws<ArgumentException>(() => VatValidator.ValidateVatAsync("LV0123456789A"));
}

[Test]
public void WhenLVVatIsTooLong()
{
Assert.Throws<ArgumentException>(() => VatValidator.ValidateVatAsync("LV01234567890000"));
}

[Test]
public void WhenLVVatIsTooShort()
{
Assert.Throws<ArgumentException>(() => VatValidator.ValidateVatAsync("LV0123456789"));
}

[Test]
public void WhenLTVatIsNumeric()
{
Assert.DoesNotThrow(() => VatValidator.ValidateVatAsync("LT012345678901"));
Assert.DoesNotThrow(() => VatValidator.ValidateVatAsync("LT012345678"));
}

[Test]
public void WhenLTVatIsAlphanumericNumeric()
{
Assert.Throws<ArgumentException>(() => VatValidator.ValidateVatAsync("LT0123456789A"));
Assert.Throws<ArgumentException>(() => VatValidator.ValidateVatAsync("LT01234567A"));
}

[Test]
public void WhenLTVatIsTooLong()
{
Assert.Throws<ArgumentException>(() => VatValidator.ValidateVatAsync("LT01234567890000"));
Assert.Throws<ArgumentException>(() => VatValidator.ValidateVatAsync("LT012345678000000000"));
}

[Test]
public void WhenLTVatIsTooShort()
{
Assert.Throws<ArgumentException>(() => VatValidator.ValidateVatAsync("LT0123456789"));
Assert.Throws<ArgumentException>(() => VatValidator.ValidateVatAsync("LT01234567"));
}
}
}
Expand Up @@ -14,7 +14,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
</ItemGroup>

<ItemGroup>
Expand Down
139 changes: 0 additions & 139 deletions org.igrok.validator.test.netfx/EmailTest.cs

This file was deleted.

0 comments on commit 9cfb11b

Please sign in to comment.