Skip to content

Instantly share code, notes, and snippets.

@guilhermekrz
Last active June 6, 2020 11:01
Show Gist options
  • Save guilhermekrz/e1ceb883f099eb8ddc6b0616d57153d2 to your computer and use it in GitHub Desktop.
Save guilhermekrz/e1ceb883f099eb8ddc6b0616d57153d2 to your computer and use it in GitHub Desktop.
@Test
fun `kotlin method with 6 parameters`() {
val kotlinFile = kotlin(
"""
package com.brokoli.lint;
class MyClass {
fun methodWith6Parameters(first: Boolean, second: String, third: Int, fourth: Long, fifth: Char, sixth: Boolean) {
}
}
"""
).indented()
val lintResult = lint()
.files(kotlinFile)
.run()
lintResult
.expectWarningCount(1)
.expect(
"""
src/com/brokoli/lint/MyClass.kt:5: Warning: Method should not declare more than 5 parameters [TooManyParametersDetector]
fun methodWith6Parameters(first: Boolean, second: String, third: Int, fourth: Long, fifth: Char, sixth: Boolean) {
^
0 errors, 1 warnings
""".trimIndent()
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment