Skip to content

Optimize and expand unit tests - #10

Merged
jellebuning merged 2 commits into
mainfrom
issues/9-optimize-and-expand-unit-tests
Oct 22, 2026
Merged

jellebuning merged 2 commits into
mainfrom
issues/9-optimize-and-expand-unit-tests

Conversation

@jellebuning

Copy link
Copy Markdown
Member

Summary

Audit and expansion of the unit test suite. Existing tests were already isolated (fixed clock, per-test temp folders, no sleeps), so the work focuses on boundary values, failure paths and edge cases, plus a few small cleanups. No source code, project files or packages changed.

What changed

  • Memento.Core.UnitTests: task parser (empty and blank input, impossible dates and times, 00:00 / 23:59 / 12:30am / 12:30pm, keyword casing and position, month, year and leap-year rollover, theories over every vocabulary entry), HourMinuteJsonConverter and MementoPaths (new), JsonSettingsStore (empty, null, non-object and corrupt files, locked file, failed save), TaskService (storage failures, unknown id, limits, edits that only change tags or time), TaskItem, HotkeyManager (fallback and retry paths), deadline reminder boundaries, service registration.
  • Memento.UnitTests: deadline formatter boundaries, TaskRowViewModel (new), hotkey text, overlay list/navigation/editing view models, settings view model.
  • Memento.EntityFramework.UnitTests: repository ordering, limits and status changes, an uninitialised database, mapper edge cases, storage error wrapping.
  • Cleanups: duplicate MissingTitle test merged into a theory, repeated arrange block in the service registration tests moved into a helper, TestParser takes an optional now, TempDataDirectory also removes a file that blocks the data folder.

Test counts: Core 96 -> 307, EntityFramework 29 -> 70, Memento.UnitTests 82 -> 204.

How it was tested

  • dotnet build --configuration Release: 0 warnings, 0 errors
  • dotnet test --project <each *.UnitTests.csproj> --configuration Release, run twice with identical results: all 581 tests pass
  • Only files under tests/ changed

Not run / not covered

  • Not run: tests/Memento.UiTests (needs an interactive desktop).
  • Not covered: WPF-bound or native classes without a testable seam (theme controller, reminder scheduler, tray icon and menu, Win32 hotkey registrar, autostart, single-instance guard, overlay window). Covering them needs source changes, which this issue rules out.

Closes #9

Add boundary, failure-path and edge-case tests across the core, WPF and
EntityFramework unit test projects, and tidy a few existing tests.
Only test files and test support helpers changed; no source or package changes.
Turn the row title test into a theory so it also checks a name other than Anna.
@jellebuning
jellebuning merged commit b59082e into main Oct 22, 2026
4 checks passed
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.

Optimize and expand unit tests

1 participant