Skip to content

Replace live URL in tests with WireMock.Net (closes #39)#43

Merged
DaraOladapo merged 1 commit into
mainfrom
fix/issue-39-wiremock-tests
May 17, 2026
Merged

Replace live URL in tests with WireMock.Net (closes #39)#43
DaraOladapo merged 1 commit into
mainfrom
fix/issue-39-wiremock-tests

Conversation

@DaraOladapo

Copy link
Copy Markdown
Owner

Summary

  • Adds WireMock.Net 2.6.0 to the test project
  • Replaces the hard-coded https://daraoladapo.com URL in all five test classes (GetTest, PostTest, PutTest, PatchTest, DeleteTest) with a local WireMockServer instance
  • Each test class starts its own server in the constructor and disposes it via IDisposable, so tests are fully isolated and offline
  • Tests now assert request headers (bearer token, custom headers, Authorization scheme+parameter) and request body content (non-empty JSON with expected fields) — not just the response type
  • Each verb has at least one non-200 response path test (404, 422, 400)
  • All 45 tests pass

Test plan

  • dotnet build — 0 errors
  • dotnet test — 45 passed, 0 failed
  • No test class references a hard-coded external URL
  • Covers no-auth, bearer token, custom headers, and Authorization object variants
  • Verifies request body and headers, not just response type
  • Covers at least one non-200 response path per HTTP verb

Closes #39

🤖 Generated with Claude Code

Removes the hard-coded https://daraoladapo.com from all test classes.
Each test class now starts a WireMockServer in its constructor and
disposes it via IDisposable, making tests offline, deterministic, and
capable of asserting request headers, body content, and non-200 paths.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@DaraOladapo DaraOladapo merged commit e2e4f5d into main May 17, 2026
11 checks passed
@DaraOladapo DaraOladapo deleted the fix/issue-39-wiremock-tests branch May 17, 2026 21:07
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.

Replace live URL in tests with mocked HTTP (WireMock.Net or similar)

1 participant