Skip to content

Instantly share code, notes, and snippets.

@ChrisMash
Last active October 16, 2023 19:32
Show Gist options
  • Save ChrisMash/8e91148b6019e79b6bd9cb8c8a2fd4eb to your computer and use it in GitHub Desktop.
Save ChrisMash/8e91148b6019e79b6bd9cb8c8a2fd4eb to your computer and use it in GitHub Desktop.
A UT that does an improved job of verifying unexpected function calls aren't made
delegate = ADelegate()
sut = UnitBeingTested(delegate)
sut.aFunctionCall()
verify(delegate)
.callMadeTo(onSuccess)
verify(delegate)
.callNOTMadeTo(onError)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment