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:
Dhawal Kapil 2019-01-26 06:45:40 +05:30 committed by Diego Moreira
parent 86aafa3976
commit 06023ec09f
1 changed files with 14 additions and 2 deletions

View File

@ -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