Skip to content

Instantly share code, notes, and snippets.

@ChrisMash
Last active October 16, 2023 19:32
Show Gist options
  • Save ChrisMash/4192e2109e2d91597fe5a5f5896b175f to your computer and use it in GitHub Desktop.
Save ChrisMash/4192e2109e2d91597fe5a5f5896b175f to your computer and use it in GitHub Desktop.
A UT that does an improved job of verifying expected behaviour
mockedDependency = mock(DependencyOfUnitBeingTested)
sut = UnitBeingTested("a value", mockedDependency)
verify(sut.value)
.is("a value")
verify(mockedDependency)
.callMadeTo(functionCalledByUnitBeingTested)
.withParameter("a value")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment