Skip to content

Conversation

@CarlTierney
Copy link

This pull request introduces significant changes to the OldXstReader and XstReader.Api projects, focusing on transitioning from manual memory management methods (e.g., ClearContents) to implementing IDisposable for resource cleanup, upgrading the target framework to .NET 8.0, and adding new unit tests for improved test coverage. Below is a categorized summary of the most important changes:

Resource Management Improvements

  • Replaced the ClearContents method with IDisposable implementations in classes such as XstElement, XstFolder, XstFile, and XstProperty to streamline resource cleanup. (src/XstReader.Api/XstElement.cs, src/XstReader.Api/XstFolder.cs, src/XstReader.Api/XstFile.cs, src/XstReader.Api/XstProperty.cs) [1] [2] [3] [4]

Framework Upgrade

  • Upgraded the target framework for the XstExporter.Portable and XstReader.Api.Tests projects from .NET 6.0 to .NET 8.0, enabling the use of the latest language features and runtime improvements. (src/XstExporter.Portable/XstExporter.Portable.csproj, src/XstReader.Api.Tests/XstReader.Api.Tests.csproj) [1] [2]

Unit Testing Enhancements

  • Added parallelized unit testing support and new test cases in XstReader.Api.Tests, including methods to validate opening and reading .pst files using the XstReader API. (src/XstReader.Api.Tests/MSTestSettings.cs, src/XstReader.Api.Tests/ReadingStreamTests.cs) [1] [2]

API Improvements

  • Introduced a new constructor in XstFile to accept a generic Stream instead of a FileStream, improving flexibility for handling different stream types (e.g., memory streams, network streams). (src/XstReader.Api/XstFile.cs)
  • Updated methods across the API to use Stream instead of FileStream for improved abstraction and compatibility. (src/XstReader.Api/Common/Map.cs, src/XstReader.Api/NDB.cs) [1] [2]

Code Simplifications and Cleanup

  • Removed redundant and unused methods like ClearContentsInternal and associated logic in multiple classes, simplifying the codebase. (src/XstReader.Api/XstElement.cs, src/XstReader.Api/XstFolder.cs, src/XstReader.Api/XstMessage.cs) [1] [2] [3]

These changes collectively modernize the codebase, enhance maintainability, and improve test coverage while aligning with best practices for resource management.

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.

1 participant