Skip to content

Introduce Unit Tests and refactor part of the code for testability and performance#11

Merged
Gpower2 merged 4 commits into
masterfrom
gp2-introduce-tests
Jun 22, 2025
Merged

Introduce Unit Tests and refactor part of the code for testability and performance#11
Gpower2 merged 4 commits into
masterfrom
gp2-introduce-tests

Conversation

@Gpower2

@Gpower2 Gpower2 commented Jun 22, 2025

Copy link
Copy Markdown
Owner

PR Classification

Refactor and enhancement of platform detection and project structure.

PR Summary

This pull request updates the project to use a new platform detection utility and improves the overall structure by adding unit tests and refactoring existing code. Key changes include:

  • gMKVExtractGUI.sln: Updated to Visual Studio version 17 and added unit test projects.
  • gTreeView.cs, NativeMethods.cs, and gMKVHelper.cs: Replaced gMKVHelper.IsOnLinux with PlatformExtensions.IsOnLinux.
  • FileExtensions.cs: Added a new file for generating output filenames.
  • Program.cs: Enhanced error handling for missing dependencies.
  • Unit tests added in DataReceivedEventArgs.Tests.cs and FileExtensions.Tests.cs to validate new functionality.

Gpower2 added 4 commits June 22, 2025 12:21
- Updated `gMKVExtractGUI.sln` for Visual Studio 17 and added unit test projects.
- Refactored `gMKVHelper` to remove `IsOnLinux`, introducing `PlatformExtensions`.
- Replaced occurrences of `gMKVHelper.IsOnLinux` with `PlatformExtensions.IsOnLinux`.
- Introduced new classes: `FileExtensions`, `gMKVVersionParser`, `PlatformExtensions`, and `ProcessExtensions` for better functionality encapsulation.
- Modified `gMKVExtract.cs` and `gMKVMerge.cs` to utilize new extensions and improve readability.
- Added unit tests for `FileExtensions` and `gMKVVersionParser`.
- Updated `gMKVToolNix.csproj` to include new source files.
- Updated `AssemblyInfo.cs` with metadata for the unit test project.
Refactor directory and file checks to use asynchronous tasks, enhancing UI responsiveness. Update file path comparison to use StringComparison.InvariantCultureIgnoreCase for better case-insensitivity handling.
This commit includes the following changes:
- Added trailing commas to several enums and options for consistency.
- Added trailing commas for consistency in enums across
  `gTaskbarProgress.cs`, `FormMkvExtractionMode.cs`, and
  `JobState.cs`.
- Reformatted error messages in `Program.cs` for better
  readability and added a check for `Newtonsoft.Json.dll`.
@Gpower2 Gpower2 merged commit eb61ed0 into master Jun 22, 2025
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