Skip to content

Fix PXFileParser encoding detection and update tests - #136

Merged
JohannesFinsveen merged 3 commits into
masterfrom
fix/null-pointer-for-alias-file
Sep 4, 2026
Merged

Fix PXFileParser encoding detection and update tests#136
JohannesFinsveen merged 3 commits into
masterfrom
fix/null-pointer-for-alias-file

Conversation

@JohannesFinsveen

Copy link
Copy Markdown
Collaborator
  • Updated PCAxis.Core.Tests.csproj to always copy Alias_en.txt as content and removed it as a None item.
  • Added Alias_en.txt test file with "Environment" content.
  • Added GetEncoding_ShouldReadAliasFile test to verify encoding detection.
  • Fixed PXFileParser.GetEncoding to return detected encoding.
  • Replaced And with AndAlso in PXFileParser.vb for safer logic.

- Updated PCAxis.Core.Tests.csproj to always copy Alias_en.txt as content and removed it as a None item.
- Added Alias_en.txt test file with "Environment" content.
- Added GetEncoding_ShouldReadAliasFile test to verify encoding detection.
- Fixed PXFileParser.GetEncoding to return detected encoding.
- Replaced And with AndAlso in PXFileParser.vb for safer logic.
Comment thread PCAxis.Core.Tests/PXFileParserTests.cs Outdated
Comment thread PCAxis.Core.Tests/PXFileParserTests.cs
Updated GetEncoding_ShouldReadAliasFile to use Path.Combine with AppContext.BaseDirectory for test file path construction. Added assertion to verify PXFileParser.GetEncoding returns Encoding.Default.
@JohannesFinsveen
JohannesFinsveen merged commit f3e7ced into master Sep 4, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants