I'm using ApprovalTests.Net. I see that I can specify various reports. I would like to automatically approve the tests when I run the unit tests. I need to do this only temporarily, or when the code goes through major changes. This is especially useful when creating data-driven ApprovalTests using ApprovalResults.ForScenario.
Is there a way to do that?
Create an reporter but rather than implementing
IApprovalFailureReporter, implementIReporterWithApprovalPower.IReporterWithApprovalPowerhas an additional method,ApprovedWhenReportedwhere you can do the work of approving the test.Here's an example reporter that will automatically copy the received file to the approved file:
You can then use it in your test class or method the way you specify any approver: