Snippets tagged approvals testing

  • Easy string approvals testing

    This simple tool is useful for string based approvals testing. When tests are run in DEBUG mode, the code opens the p4merge diff tool (change it to point to yours) to clearly show the differences between the expected and actual strings. The actual, or received string is copied, in escaped form, to the clipboard so that it can be easily pasted into the associated test to approve the changes if appropriate. When a debugger isn't attached, this tool reverts to using a standard Assert so that it won't attempt to open a diff viewer when executed on a CI server.

    1 people like this

    Posted: 4 years ago by Russell Politzky