Skip to content

test: add test project with phase 1 coverage - #23

Merged
jonas1307 merged 1 commit into
mainfrom
test/phase-1
Jul 25, 2026
Merged

test: add test project with phase 1 coverage#23
jonas1307 merged 1 commit into
mainfrom
test/phase-1

Conversation

@jonas1307

Copy link
Copy Markdown
Owner

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.Tests project (net10.0, IsPackable=false), joined to devops-cli.slnx. 49 tests, all green.
    • ActionHelpersVoteValue/VoteText (incl. unknown throws / fallback), ParentTypeAbbreviation, ResolveRelationType, Truncate, ShortBranch, DescribeCount (singular/plural/truncation), and ResolvePullRequestUrl (web-link and null paths).
    • GitHelper.CurrentBranch.git/HEAD parsing: normal ref, detached HEAD, and no-git — via a temp dir + restored working directory.
    • TitleNormalizer — the skip/prefix logic for normalize.
  • CIdotnet test devops-cli.slnx -c Release --no-build between build and pack.

Small refactor

  • Extracted TitleNormalizer (the two regexes + title builder) out of NormalizeAction so the logic is unit-testable; the action now calls it. Behavior unchanged.

Parallelization is disabled at the assembly level because GitHelper reads the process working directory; the suite runs in ~1s. The working directory is restored via IDisposable.

Pack of the tool is unaffected — dotnet pack DevOps/DevOps.csproj still produces only azure-devops-cli.nupkg.

Closes #22

…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.
@jonas1307
jonas1307 merged commit 3e6fa1b into main Jul 25, 2026
1 check passed
@jonas1307
jonas1307 deleted the test/phase-1 branch July 25, 2026 04:14
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.

Add a test project and dotnet test in CI

1 participant