Created
August 19, 2023 14:13
-
-
Save ProArun/f7f8142e4a70dd44389bb4db960ce376 to your computer and use it in GitHub Desktop.
parameterized Test Case
This file contains hidden or 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
@RunWith(value = Parameterized::class) | |
class ParameterizedExample(val input:String,val expectedValue:Boolean){ | |
@Test | |
fun test(){ | |
val helper = Helper() | |
val result = helper.isPallindrome(input) | |
assertEquals(expectedValue,result) | |
} | |
companion object{ | |
@JvmStatic | |
@Parameterized.parameters(name = "{index} : {0} is pallindrome - {1}") | |
fun data():List<Array<Any>>{ | |
return ListOf( | |
arrayOf("hello",false), | |
arrayOf("level",true), | |
arrayOf("a",true), | |
arrayOf("",true) | |
) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment