Skip to main content

Payroll API Testing Guide

Summary

Payroll has smoke, scenario, parity, and cutover scripts but no formal Payroll .NET test project.

Audience

Frontend and backend developers, QA and support engineers, architects, security reviewers, and implementation partners.

Overview

Existing test assets

Source-backed scripts cover native Payroll scenarios, compatibility behavior, route-source cutover, monolith/service parity, go/no-go evidence, and broader scenario validation. Run them only in isolated test environments with synthetic data; this page does not provide production commands or credentials.

LayerRequired coverage
Contract testsMethods, routes, binding, response types, status/body conventions, files and content types
Application integrationRun list/retrieve, invalid periods, duplicate editable runs, missing Attendance, optional inputs, recalculation and Frozen block
Freeze/unfreezeDuplicate freeze, insufficient recovery, recovery application/reversal, native/compatibility parity
ComponentsCreate/update/deactivate, active listing, unknown category/basis behavior, missing component
Payslips/PDFFrozen eligibility, structured generation, PDF content type, regeneration, missing detail, employee-self/admin authorization once confirmed
ExportsFrozen bank eligibility, general CSV, empty run, data minimization, and no payment assumption
GatewayDirect/shadow, compatibility ownership, rollback, route-source evidence and parity
Consumer/read modelMissing Attendance, optional Leave/Expense, duplicate/stale events and projection reconciliation
Negative/securityMissing/invalid tenant, cross-tenant access, absent/invalid bearer context, unauthorized role, malformed body and identifier

Safe execution sequence

  1. Create synthetic tenant-period projections in an isolated environment.
  2. Exercise list/retrieve and invalid-period paths.
  3. Calculate with complete and missing Attendance coverage; add optional Leave, Expense, overtime, advance and component inputs independently.
  4. Recalculate, freeze, repeat freeze, generate payslip/PDF/exports, then unfreeze and verify recovery behavior.
  5. Repeat through compatibility routes and compare only supported contract fields.
  6. Verify gateway cutover and rollback without allowing production writes.

Recommended tests are not claimed to exist.

Source References

  • microservices/scripts/smoke-payroll.ps1
  • microservices/scripts/smoke-payroll-cutover.ps1
  • microservices/scripts/compare-payroll-parity.ps1
  • microservices/scripts/payroll-cutover-go-no-go.ps1
  • scripts/validate-payroll-scenarios.ps1
  • microservices/src/payroll-service/Api/PayrollRunEndpoints.cs
  • microservices/src/payroll-service/Api/PayrollCompatEndpoints.cs

See Also

Keywords

  • Payroll API
  • Payroll API Testing Guide

Revision Information

  • Status: Draft
  • Last reviewed: 2026-07-15
  • Review cycle: Quarterly