Skip to content

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

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

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

Conversation

@jonas1307

Copy link
Copy Markdown
Owner

Test project + phase 1 coverage

Adds the first automated test coverage to the repo (xUnit), targeting the highest-risk pure logic.

Added

  • Timetracker.Tests project (net10.0, IsPackable=false), joined to Timetracker.slnx. 67 tests, all green.
    • PeriodResolver — mutual exclusivity, --from > --to, invalid --period, shortcut + --from; today/yesterday/range/period success; and time-relative invariants for week (Mon–Sun, 7 days), last-week (−7d), month/last-month.
    • ValidationUtilsValidActivityDate, ValidUrl (HTTPS enforced), TryResolveMonth (incl. leap year), ValidType (case-insensitive).
    • AddValidator, UpdateValidator, ConfigValidator — happy paths and each failing rule.
  • CIdotnet test Timetracker.slnx -c Release --no-build step between build and pack.

Deliberately out of scope (follow-up)

  • Time is asserted via invariants (span/DayOfWeek), so tests don't expire; a TimeProvider seam for absolute-date tests is deferred.
  • ConfigValidator's first-time-setup rules depend on ConfigService.ConfigExists() (real I/O) and are deferred until that check can be injected.

Pack of the tool is unaffected — dotnet pack Timetracker still produces only timetracker-cli.nupkg.

Closes #27

@jonas1307
jonas1307 merged commit 6dad561 into main Jul 25, 2026
1 check passed
@jonas1307
jonas1307 deleted the test/phase-1 branch July 25, 2026 03:42
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