Skip to content

Commit

Permalink
Feature/bael 2129 (eugenp#6182)
Browse files Browse the repository at this point in the history
* BAEL-2129 Added Unit test for Void Type in Kotlin article

* BAEL-2129 Updated test case

* BAEL-2129 Added comment for commented code
  • Loading branch information
dkapil authored and diegomoreira001 committed Jan 26, 2019
1 parent 86aafa3 commit 06023ec
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -36,7 +48,7 @@ class VoidTypesUnitTest {

@Test
fun givenVoidReturnType_thenReturnsNullOnly() {
assertNull(returnTypeAsVoid())
assertNull(returnTypeAsVoidSuccess())
}

@Test
Expand Down

0 comments on commit 06023ec

Please sign in to comment.