MatchApproved
// In your test setup
ShouldlyConfiguration.ShouldMatchApprovedDefaults.ConfigureDiffEngine();Approved File does not exist
var simpsonsQuote = "Hi Super Nintendo Chalmers";
simpsonsQuote.ShouldMatchApproved();To approve the changes run this command:
copy /Y "C:\PathToCode\shouldly\src\DocumentationExamples\ShouldMatchApprovedExamples.ApprovedFileDoesNotExist.received.txt" "C:\PathToCode\shouldly\src\DocumentationExamples\ShouldMatchApprovedExamples.ApprovedFileDoesNotExist.approved.txt"
----------------------------
Approval file C:\PathToCode\shouldly\src\DocumentationExamples\ShouldMatchApprovedExamples.ApprovedFileDoesNotExist.approved.txt
does not exist
Approved File does not match received

Options and customisation
Defaults
Usage
DoNotIgnoreLineEndings
WithStringCompareOptions
WithDiscriminator
Diff
NoDiff
WithFileExtension
SubFolder
UseCallerLocation
LocateTestMethodUsingAttribute
WithScrubber
Configuration
Changing default options
Diff tools
Last updated