mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 03:37:59 +01:00
This pull request introduces a new unit testing framework for the `WorkspacesLib` module, adds test coverage for various utilities, and integrates the new test project into the build system. Key changes include adding the `WorkspacesLibUnitTests` project, implementing tests for `AppUtils`, `JsonUtils`, and `PwaHelper`, and updating the build configuration to include the new test project. ### Unit Tests Added: * **`AppUtilsTests`**: - Added comprehensive tests for methods such as `GetCurrentFolder`, `IsEdge`, `IsChrome`, and `IsSteamGame` to validate their behavior under various conditions. * **`JsonUtilsTests`**: - Implemented tests for reading and writing workspace data, including scenarios for invalid JSON, non-existent files, and valid workspace lists. * **`PwaHelperTests`**: - Added tests to ensure the stability of `PwaHelper` methods, such as `GetEdgeAppId`, `GetChromeAppId`, and `SearchPwaName`, even with invalid or empty inputs. ### Build System Updates: * **New Test Project Integration**: - Added the `WorkspacesLibUnitTests` project to the solution file `PowerToys.sln` with appropriate dependencies. - Updated build configurations to include the new test project for both Debug and Release builds across architectures. [[1]](diffhunk://#diff-ca837ce490070b91656ffffe31cbad8865ba9174e0f020231f77baf35ff3f811R2208-R2215) [[2]](diffhunk://#diff-ca837ce490070b91656ffffe31cbad8865ba9174e0f020231f77baf35ff3f811R2841) ### Pipeline Adjustments: * **Test Discovery**: - Updated the pipeline configuration in `.pipelines/v2/templates/job-build-project.yml` to discover the new `WorkspacesLibUnitTests.dll` during test runs. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>