Last active
June 6, 2020 11:01
-
-
Save guilhermekrz/e1ceb883f099eb8ddc6b0616d57153d2 to your computer and use it in GitHub Desktop.
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
@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