Last active
October 28, 2017 21:36
-
-
Save yayaa/88d3ee6cf7e130a15337dd93dad5a465 to your computer and use it in GitHub Desktop.
How to Test Builder - 7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SampleBuilderTest { | |
val mockSampleObject = mock<SampleObject>() | |
val mockSampleBuilder = mockBuilder<SampleObject.Builder>(mockSampleObject) | |
@Test fun `when super business logic runs should do important stuff with correct configuration`() { | |
SampleLogic(mockSampleBuilder).superBusinessLogic() | |
verifyInOrder(mockSampleBuilder) { | |
configA(true) | |
configB("something") | |
enableConfigC() | |
build() | |
} | |
verify(mockSampleObject).doImportantStuff() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment