Created
May 4, 2018 11:53
-
-
Save EricDw/c4778a1c21b5ec31d9a925f24cabe5a7 to your computer and use it in GitHub Desktop.
Utility functions to aid in cratfting kotlin JUnit tests.
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
import org.junit.Assert.assertTrue | |
fun assertTrueWithMessage(input: Any, expectedOutput: Any, actualOutput: Any) { | |
assertTrue( | |
createMessage(input, expectedOutput, actualOutput), | |
actualOutput == expectedOutput) | |
} | |
fun createMessage(input: Any, expectedOutput: Any, actualOutput: Any): String { | |
return "input was\n $input\n " + | |
"expected output was\n $expectedOutput\n " + | |
"actual output was\n $actualOutput" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment