Not that much difficult, the second encounter introduces some more advanced features.
Kotlin supports infix syntax. That’s it.
Definition of done: Make InfixSpec
test pass (without comments).
Another simple task - explore the usage of lazy loading and delegated properties.
Definition of done: Make LazySpec
test pass.
Reference: https://kotlinlang.org/docs/reference/delegated-properties.html
Implement rangeTo
function in MyDate
class so that you’re able to use ..
operator.
Then implement checkInRange
method that should check whether date
is within (first, last)
range.
Definition of done: Make DateRangeSpec
test pass.
Reference: https://kotlinlang.org/docs/reference/ranges.html
You’ve ever used switch
on an enum
and had to define default like I don't know what to do know, throw an exception I guess?
because that’s how you do it in Java? Well that’s what sealed
classes are for (too).
Definition of done: Refactor SchrodingersCat
to a sealed class and refactor SchrodingersCatSpec
test so that it passes.
Reference: https://kotlinlang.org/docs/reference/classes.html#sealed-classes
Not that much difficult, the second encounter introduces some more advanced features.
Kotlin supports infix syntax. That’s it.
Definition of done: Make InfixSpec
test pass (without comments).
Another simple task - explore the usage of lazy loading and delegated properties.
Definition of done: Make LazySpec
test pass.
Reference: https://kotlinlang.org/docs/reference/delegated-properties.html
Implement rangeTo
function in MyDate
class so that you’re able to use ..
operator.
Then implement checkInRange
method that should check whether date
is within (first, last)
range.
Definition of done: Make DateRangeSpec
test pass.
Reference: https://kotlinlang.org/docs/reference/ranges.html
You’ve ever used switch
on an enum
and had to define default like I don't know what to do know, throw an exception I guess?
because that’s how you do it in Java? Well that’s what sealed
classes are for (too).
Definition of done: Refactor SchrodingersCat
to a sealed class and refactor SchrodingersCatSpec
test so that it passes.
Reference: https://kotlinlang.org/docs/reference/classes.html#sealed-classes