Feature/bael 2129 (#6182)
* BAEL-2129 Added Unit test for Void Type in Kotlin article * BAEL-2129 Updated test case * BAEL-2129 Added comment for commented code
This commit is contained in:
parent
86aafa3976
commit
06023ec09f
|
@ -6,7 +6,19 @@ import kotlin.test.assertTrue
|
|||
|
||||
class VoidTypesUnitTest {
|
||||
|
||||
fun returnTypeAsVoid(): Void? {
|
||||
// Un-commenting below methods will result into compilation error
|
||||
// as the syntax used is incorrect and is used for explanation in tutorial.
|
||||
|
||||
// fun returnTypeAsVoidAttempt1(): Void {
|
||||
// println("Trying with Void as return type")
|
||||
// }
|
||||
|
||||
// fun returnTypeAsVoidAttempt2(): Void {
|
||||
// println("Trying with Void as return type")
|
||||
// return null
|
||||
// }
|
||||
|
||||
fun returnTypeAsVoidSuccess(): Void? {
|
||||
println("Function can have Void as return type")
|
||||
return null
|
||||
}
|
||||
|
@ -36,7 +48,7 @@ class VoidTypesUnitTest {
|
|||
|
||||
@Test
|
||||
fun givenVoidReturnType_thenReturnsNullOnly() {
|
||||
assertNull(returnTypeAsVoid())
|
||||
assertNull(returnTypeAsVoidSuccess())
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue