Skip to content

Add 156 unit tests for under-covered modules#5

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1782424266-add-unit-tests
Open

Add 156 unit tests for under-covered modules#5
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1782424266-add-unit-tests

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Summary

Adds 156 new unit tests (234 → 390 total) targeting modules that had zero or minimal test coverage.

New Hookline.SharedKernel.Tests project — previously untested:

  • ResultTestsResult.Success(), Result.Failure(error), Result<T> implicit operators (T → Result<T>, Error → Result<T>), predefined Error status codes
  • PagedResultTestsTotalPages ceiling division, HasNext/HasPrevious edge cases, PageRequest.SafePage/SafePageSize clamping (negative, zero, >MaxPageSize), Skip offset
  • CsvTests — RFC 4180 Field() quoting (comma, quote, CR, LF triggers), Row() joining, Document() CRLF termination

Infrastructure.Tests additions:

  • PasswordHasherTests — bcrypt hash format, nondeterminism, verify correct/wrong password, SaltParseException → false for invalid hash
  • IdentityTokenServiceTests — constructor rejects null/empty/whitespace key, Sign → two-part base64url token, Verify roundtrips userId+role, rejects tampered/wrong-key/expired tokens
  • HooklineUserTestsHasAtLeast(role) hierarchy (Owner ≥ Admin ≥ Member), Anonymous/System/Authenticated() factory invariants

YouTubeUploads.Tests additions:

  • SlackMrkdwnTests — entity expansion (<@U|name>@name, <#C|ch>#ch, <!here>@here, <url|label>label (url)), &amp;/&lt;/&gt; decode, angle-bracket stripping, emoji shortcode pass-through
  • SlackEmojiTests — known shortcode → Unicode, :skin-tone-N: → stripped, unknown codes pass through, non-emoji colons like 16:9 unchanged
  • ProgressTrackerTestsSet/Get/Remove on ConcurrentDictionary, JobProgress.Percent clamping (0–100, BytesTotal=0 → 0)
  • ApiUsageReportTestsBuild() produces YouTube/Drive/Slack groups, metric summation across multiple clients, Slack sorted descending, scope label resolution

YouTubeComments.Tests additions:

  • PacificTimeTestsToday() validity, TodayKey() format/roundtrip, StartOfToday()/UntilMidnight() bounds
  • GoogleApiExceptionExtensionsTestsIsTransientStatus (5xx/429 = true, 4xx = false), HasReason case-insensitive matching, null-safe
  • PollingFrequencyTests + ReplyScanFrequencyTestsToCron/ToInterval enum mapping, ReplyScanFrequency.Off → null

Link to Devin session: https://app.devin.ai/sessions/31abc6001d334122b892687c2d8e6a41
Requested by: @skyp1nus

New SharedKernel.Tests project:
- ResultTests: Success/Failure factories, implicit operators, Error constants
- PagedResultTests: TotalPages, HasNext/Previous, PageRequest clamping
- CsvTests: RFC 4180 field quoting, row joining, document generation

Infrastructure.Tests additions:
- PasswordHasherTests: bcrypt hash/verify, nondeterminism, invalid hash
- IdentityTokenServiceTests: sign/verify roundtrip, expiry, key validation
- HooklineUserTests: role hierarchy, Anonymous/System/Authenticated factories

YouTubeUploads.Tests additions:
- SlackMrkdwnTests: entity expansion, HTML escapes, emoji conversion
- SlackEmojiTests: shortcode mapping, skin-tone filtering, unknown passthrough
- ProgressTrackerTests: Set/Get/Remove ops, Percent clamping
- ApiUsageReportTests: report structure, metric summation, scope labels

YouTubeComments.Tests additions:
- PacificTimeTests: Today/TodayKey/StartOfToday/UntilMidnight
- GoogleApiExceptionExtensionsTests: transient status, HasReason matching
- PollingFrequencyTests: ToCron/ToInterval for both frequency enums

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@skyp1nus skyp1nus self-assigned this Jun 25, 2026
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

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.

1 participant