Skip to content

Approval test infrastructure for Particular repositories

License

Notifications You must be signed in to change notification settings

Particular/Particular.Approvals

Repository files navigation

Particular.Approvals

This repo contains our standardized way of using approval tests to verify and highlight any changes to public APIs.

Deployment

Tagged versions are automatically pushed to feedz.io. After validating new versions, the package should be promoted to production by pushing the package to NuGet using the feedz.io push upstream feature.

Migration to Particular.Approvals

  1. Remove ApprovalTests, ApprovalUtilities, and ObjectApproval packages
  2. Add Particular.Approvals package
  3. Update PublicApiGenerator to latest version
  4. Remove <Optimize>False</Optimize> from test project file
  5. Remove any [MethodImpl(MethodImplOptions.NoInlining)] from tests using approvals
  6. Update tests to use Approver.Verify()
  7. Move all approval files into an ApprovalFiles folder in the root of the test project
  8. Remove ApprovalTestConfig.cs, TestApprover.cs, etc (anything directly referencing ApprovalTests)

After conversion, an API approval test should look identical to the following (other than adjusting the specific type, of course): https://github.com/Particular/NServiceBus.AzureStorageQueues/blob/master/src/Tests/APIApprovals.cs

If a project isn't multi-targeted you could skip the excludeAttributes, but it wouldn't hurt to have it regardless.

About

Approval test infrastructure for Particular repositories

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages