Introduce Unit Tests and refactor part of the code for testability and performance#11
Merged
Conversation
- 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`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, andgMKVHelper.cs: ReplacedgMKVHelper.IsOnLinuxwithPlatformExtensions.IsOnLinux.FileExtensions.cs: Added a new file for generating output filenames.Program.cs: Enhanced error handling for missing dependencies.DataReceivedEventArgs.Tests.csandFileExtensions.Tests.csto validate new functionality.