This repo contains our standardized way of using approval tests to verify and highlight any changes to public APIs.
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.
- Remove
ApprovalTests
,ApprovalUtilities
, andObjectApproval
packages - Add
Particular.Approvals
package - Update
PublicApiGenerator
to latest version - Remove
<Optimize>False</Optimize>
from test project file - Remove any
[MethodImpl(MethodImplOptions.NoInlining)]
from tests using approvals - Update tests to use
Approver.Verify()
- Move all approval files into an ApprovalFiles folder in the root of the test project
- 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.