test: add test project with phase 1 coverage - #23
Merged
Merged
Conversation
…r, normalize) Extract TitleNormalizer from NormalizeAction so the skip/prefix logic is unit-testable, and add an xUnit project covering ActionHelpers pure helpers, GitHelper branch parsing, and title normalization. Wire dotnet test into CI.
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.
Test project + phase 1 coverage
Brings the same test setup used in timetracker-cli to this repo (xUnit), targeting the highest-risk pure logic.
Added
DevOps.Testsproject (net10.0,IsPackable=false), joined todevops-cli.slnx. 49 tests, all green.ActionHelpers—VoteValue/VoteText(incl. unknown throws / fallback),ParentTypeAbbreviation,ResolveRelationType,Truncate,ShortBranch,DescribeCount(singular/plural/truncation), andResolvePullRequestUrl(web-link and null paths).GitHelper.CurrentBranch—.git/HEADparsing: normal ref, detached HEAD, and no-git — via a temp dir + restored working directory.TitleNormalizer— the skip/prefix logic fornormalize.dotnet test devops-cli.slnx -c Release --no-buildbetween build and pack.Small refactor
TitleNormalizer(the two regexes + title builder) out ofNormalizeActionso the logic is unit-testable; the action now calls it. Behavior unchanged.Parallelization is disabled at the assembly level because
GitHelperreads the process working directory; the suite runs in ~1s. The working directory is restored viaIDisposable.Pack of the tool is unaffected —
dotnet pack DevOps/DevOps.csprojstill produces onlyazure-devops-cli.nupkg.Closes #22