Skip to content

Update NuGet packages and refactor test lifecycle#6

Open
HowardvanRooijen wants to merge 15 commits intomainfrom
features/2025-06-updates
Open

Update NuGet packages and refactor test lifecycle#6
HowardvanRooijen wants to merge 15 commits intomainfrom
features/2025-06-updates

Conversation

@HowardvanRooijen
Copy link
Contributor

Updated several NuGet packages in Ais.Net.Models.Specs.csproj to their latest versions, including coverlet.msbuild, Microsoft.NET.Test.Sdk, NUnit3TestAdapter, Reqnroll.NUnit, and Shouldly.

Added [NUnit.Framework.FixtureLifeCycleAttribute(NUnit.Framework.LifeCycle.InstancePerTestCase)] to AisMessageType18Feature for improved test fixture management. Refactored FeatureSetupAsync and FeatureTearDownAsync methods to be static, enhancing test setup practices.

Enhanced TestInitializeAsync, ScenarioStartAsync, and ScenarioCleanupAsync methods for better error handling and resource management. Updated packages.lock.json to reflect new package versions and modified Ais.Net.Models.csproj to upgrade Endjin.RecommendedPractices.GitHub from 2.1.13 to 2.1.18.

Updated several NuGet packages in `Ais.Net.Models.Specs.csproj` to their latest versions, including `coverlet.msbuild`, `Microsoft.NET.Test.Sdk`, `NUnit3TestAdapter`, `Reqnroll.NUnit`, and `Shouldly`.

Added `[NUnit.Framework.FixtureLifeCycleAttribute(NUnit.Framework.LifeCycle.InstancePerTestCase)]` to `AisMessageType18Feature` for improved test fixture management. Refactored `FeatureSetupAsync` and `FeatureTearDownAsync` methods to be static, enhancing test setup practices.

Enhanced `TestInitializeAsync`, `ScenarioStartAsync`, and `ScenarioCleanupAsync` methods for better error handling and resource management. Updated `packages.lock.json` to reflect new package versions and modified `Ais.Net.Models.csproj` to upgrade `Endjin.RecommendedPractices.GitHub` from `2.1.13` to `2.1.18`.
@github-actions
Copy link

github-actions bot commented Jun 16, 2025

Test Results

8 tests  +7   8 ✅ +7   0s ⏱️ ±0s
1 suites ±0   0 💤 ±0 
1 files   ±0   0 ❌ ±0 

Results for commit 0270c1b. ± Comparison against base commit cd6afc3.

This pull request removes 1 and adds 8 tests. Note that renamed tests count towards both.
Ais.Net.Models.Specs.Features.AisMessageType18Feature ‑ CreateAisMessageType18Record
Ais.Net.Models.Specs.Features.ClassAVesselPositionReportFeature ‑ DecodingAClassAVesselPositionReport("123.45","NotAvailable","12345","UnderwayUsingEngine","1.0","2.0","true","12.34",null)
Ais.Net.Models.Specs.Features.ClassAVesselPositionReportFeature ‑ DecodingAClassAVesselPositionReport("234.56","NotAvailable","54321","AtAnchor","3.0","4.0","true","0.0",null)
Ais.Net.Models.Specs.Features.ClassBCSPositionReportFeature ‑ DecodingAClassBCSPositionReport("true","true","123.45","Cstdma","true","true","true","12345","1.0","2.0","true","Itdma","true","1","2","3","12.34","56","78",null)
Ais.Net.Models.Specs.Features.ClassBSOPositionReportFeature ‑ DecodingAClassBSOPositionReport("123.45","1","2","3","4","true","true","12345","1.0","2.0","true","Gps","true","1","2","3","SHIP","60","1","12.34","56","78",null)
Ais.Net.Models.Specs.Features.Long_RangeAISBroadcastMessageFeature ‑ DecodingALong_RangeAISBroadcastMessage("123.45","true","12345","UnderwayUsingEngine","1.0","2.0","true","true","3","12.34",null)
Ais.Net.Models.Specs.Features.StaticAndVoyageRelatedDataFeature ‑ DecodingStaticAndVoyageRelatedData("1","CALL","DEST","1","2","3","4","5","6","7","8","9","true","123","12345","Gps","3","60","1","VESSEL",null)
Ais.Net.Models.Specs.Features.StaticDataReportPartAFeature ‑ DecodingAStaticDataReportPartA("12345","0","3","1",null)
Ais.Net.Models.Specs.Features.StaticDataReportPartBFeature ‑ DecodingAStaticDataReportPartB("CALL","1","2","3","4","12345","54321","1","3","123","1","60","1","VEN","DOR",null)

♻️ This comment has been updated with latest results.

JamesDawson and others added 4 commits June 17, 2025 11:58
Updated `Ais.Net.Models.Specs.csproj` to include new compile and feature item groups for `.feature.cs` and `.feature` files. Introduced nullable types and null checks in `AisMessageType18StepDefinitions.cs` for better data integrity. Added new step definition classes for `AisMessageType19`, `AisMessageType1Through3`, `AisMessageType24Part0`, `AisMessageType24Part1`, `AisMessageType27`, and `AisMessageType5`, each with methods for creating records and validating properties. Corresponding feature files were auto-generated to define scenarios for testing the new message types.
This commit refactors several AIS message type step definition classes to inherit from a new base class `StepDefinitionBase`, introducing a common `Message` property for better management of created AIS messages. The `PositionData` class is updated to use `double` for `Latitude` and `Longitude` for improved precision.

A new `CommonStepDefinitions` class is added for shared background steps, and feature files are renamed for clarity, utilizing parameterized examples. Additionally, a `Hooks` class is introduced to handle pre- and post-scenario logic, enhancing the overall structure and maintainability of the tests.
Removed `<None>` elements for settings files and eliminated
`<Compile>` and `<ReqnrollFeature>` elements related to
feature files. This simplifies the project structure and
may streamline the build process.
@ais-dotnet ais-dotnet deleted a comment from github-actions bot Jun 18, 2025
@github-actions
Copy link

Code Coverage Summary Report - Linux (No TFM)

Summary
Generated on: 06/19/2025 - 16:41:01
Parser: Cobertura
Assemblies: 1
Classes: 10
Files: 10
Line coverage: 35.5% (105 of 295)
Covered lines: 105
Uncovered lines: 190
Coverable lines: 295
Total lines: 489
Branch coverage: 0% (0 of 47)
Covered branches: 0
Total branches: 47
Method coverage: Feature is only available for sponsors

Coverage

Ais.Net.Models - 35.5%
Name Line Branch
Ais.Net.Models 35.5% 0%
Ais.Net.Models.Abstractions.Position 33.3%
Ais.Net.Models.AisMessageBase 100%
Ais.Net.Models.AisMessageExtensions 0% 0%
Ais.Net.Models.AisMessageType18 94.7%
Ais.Net.Models.AisMessageType19 95.4%
Ais.Net.Models.AisMessageType1Through3 94.1%
Ais.Net.Models.AisMessageType24Part0 80%
Ais.Net.Models.AisMessageType24Part1 93.7%
Ais.Net.Models.AisMessageType27 90%
Ais.Net.Models.AisMessageType5 95.2%

@github-actions
Copy link

Code Coverage Summary Report - Windows (No TFM)

Summary
Generated on: 6/19/2025 - 4:41:58 PM
Parser: Cobertura
Assemblies: 1
Classes: 10
Files: 10
Line coverage: 35.5% (105 of 295)
Covered lines: 105
Uncovered lines: 190
Coverable lines: 295
Total lines: 453
Branch coverage: 0% (0 of 47)
Covered branches: 0
Total branches: 47
Method coverage: Feature is only available for sponsors

Coverage

Ais.Net.Models - 35.5%
Name Line Branch
Ais.Net.Models 35.5% 0%
Ais.Net.Models.Abstractions.Position 33.3%
Ais.Net.Models.AisMessageBase 100%
Ais.Net.Models.AisMessageExtensions 0% 0%
Ais.Net.Models.AisMessageType18 94.7%
Ais.Net.Models.AisMessageType19 95.4%
Ais.Net.Models.AisMessageType1Through3 94.1%
Ais.Net.Models.AisMessageType24Part0 80%
Ais.Net.Models.AisMessageType24Part1 93.7%
Ais.Net.Models.AisMessageType27 90%
Ais.Net.Models.AisMessageType5 95.2%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants