Skip to content

Commit 62efc25

Browse files
authored
Merge pull request #35 from jonsagara/release/3.1.0
Merge 3.1.0 into main for release
2 parents 50b49e9 + 7f3184b commit 62efc25

17 files changed

Lines changed: 172 additions & 39 deletions
493 KB
Binary file not shown.
1.83 MB
Binary file not shown.
944 KB
Binary file not shown.
1.92 MB
Binary file not shown.

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "8.0.200",
3+
"version": "9.0.100",
44
"rollForward": "latestPatch"
55
}
66
}

src/IdParser.Core.Benchmarks/IdParser.Core.Benchmarks.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net8.0</TargetFramework>
5+
<TargetFramework>net9.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
11+
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" />
12+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.0" />
1213
</ItemGroup>
1314

1415
<ItemGroup>

src/IdParser.Core.Client/IdParser.Core.Client.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net8.0-windows</TargetFramework>
3+
<TargetFramework>net9.0-windows</TargetFramework>
44
<OutputType>WinExe</OutputType>
55
<AssemblyName>ID Parser</AssemblyName>
66
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
@@ -28,13 +28,13 @@
2828
<Content Include="ID Parser Icon.ico" />
2929
</ItemGroup>
3030
<ItemGroup>
31-
<Reference
32-
Include="Microsoft.PointOfService, Version=1.14.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
31+
<Reference Include="Microsoft.PointOfService, Version=1.14.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
3332
<SpecificVersion>False</SpecificVersion>
3433
<HintPath>..\..\lib\Microsoft.PointOfService.dll</HintPath>
3534
</Reference>
3635
</ItemGroup>
3736
<ItemGroup>
37+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.0" />
3838
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
3939
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
4040
</ItemGroup>

src/IdParser.Core.Client/Main.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,14 @@ private void Disconnect()
7676
try
7777
{
7878
SetStatus(Level.Info, "Disconnecting scanner");
79-
RemoveDataEvent(_scanner);
80-
_scanner.DeviceEnabled = false;
81-
_scanner.Release();
82-
_scanner.Close();
79+
80+
if (_scanner is not null)
81+
{
82+
RemoveDataEvent(_scanner);
83+
_scanner.DeviceEnabled = false;
84+
_scanner.Release();
85+
_scanner.Close();
86+
}
8387

8488
SetStatus(Level.Success, "Scanner disconnected");
8589
}

src/IdParser.Core.Test/DriversLicenseTests.cs

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,49 @@ public void TestNYLicense()
192192
Assert.Equal("New York", parseResult.Card.IssuerIdentificationNumber.Value.GetDescriptionOrDefault());
193193
}
194194

195+
[Fact]
196+
public void TestNYLicenseWithAAMVA2000Height()
197+
{
198+
var expected = new DriversLicense
199+
{
200+
FirstName = FV<string?>(SubfileElementIds.FirstName, "ALDO"),
201+
MiddleName = FV<string?>(SubfileElementIds.MiddleName, null),
202+
LastName = FV<string?>(SubfileElementIds.LastName, "ADAMS"),
203+
204+
StreetLine1 = FV<string?>(SubfileElementIds.StreetLine1, "1234 ANY STREET"),
205+
City = FV<string?>(SubfileElementIds.City, "ANYTOWN"),
206+
JurisdictionCode = FV<string?>(SubfileElementIds.JurisdictionCode, "NY"),
207+
PostalCode = FV<string?>(SubfileElementIds.PostalCode, "11111"),
208+
Country = FV<Country>(SubfileElementIds.Country, Country.USA),
209+
210+
DateOfBirth = FV<DateTime?>(SubfileElementIds.DateOfBirth, new DateTime(1972, 2, 2)),
211+
Sex = FV<Sex?>(SubfileElementIds.Sex, Sex.Male),
212+
Height = FV<Height?>(SubfileElementIds.Height, new Height(feet: 6, inches: 1)),
213+
EyeColor = FV<EyeColor?>(SubfileElementIds.EyeColor, EyeColor.Brown),
214+
215+
IdNumber = FV(SubfileElementIds.IdNumber, "123456789"),
216+
AAMVAVersionNumber = FV(null, AAMVAVersion.AAMVA2005),
217+
218+
IssueDate = FV<DateTime?>(SubfileElementIds.IssueDate, new DateTime(2019, 2, 2)),
219+
ExpirationDate = FV<DateTime?>(SubfileElementIds.ExpirationDate, new DateTime(2028, 2, 2)),
220+
221+
RevisionDate = FV<DateTime?>(SubfileElementIds.RevisionDate, new DateTime(2017, 9, 9)),
222+
ComplianceType = FV<ComplianceType?>(SubfileElementIds.ComplianceType, ComplianceType.FullyCompliant),
223+
224+
VehicleClass = FV<string?>(SubfileElementIds.VehicleClass, "DM"),
225+
};
226+
227+
var file = License("NY AAMVA2005 Height");
228+
var parseResult = Barcode.Parse(file, Validation.None);
229+
LogUnhandledElementIds(parseResult);
230+
231+
AssertNoErrors(parseResult);
232+
AssertIdCard(expected, parseResult.Card);
233+
AssertLicense(expected, parseResult.Card);
234+
235+
Assert.Equal("New York", parseResult.Card.IssuerIdentificationNumber.Value.GetDescriptionOrDefault());
236+
}
237+
195238
[Fact]
196239
public void TestVALicense()
197240
{

src/IdParser.Core.Test/IdParser.Core.Test.csproj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
66
<AssemblyTitle>IdParser.Core.Test</AssemblyTitle>
77
<Product>IdParser.Core.Test</Product>
@@ -24,9 +24,10 @@
2424
</Content>
2525
</ItemGroup>
2626
<ItemGroup>
27-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
28-
<PackageReference Include="xunit" Version="2.7.0" />
29-
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
27+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.0" />
28+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
29+
<PackageReference Include="xunit" Version="2.9.2" />
30+
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
3031
<PrivateAssets>all</PrivateAssets>
3132
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
3233
</PackageReference>

0 commit comments

Comments
 (0)