package iii_properties

import junit.framework.Assert
import org.junit.Test as test

class _18_Properties {
    test fun testPropertyWithCounter() {
        val q = PropertyExample()
        q.propertyWithCounter = 14
        q.propertyWithCounter = 21
        q.propertyWithCounter = 32
        Assert.assertEquals("The property q.changeCounter should contain the number of assignments to q.propertyWithCounter:",
                3, q.counter)
        Assert.assertEquals("The property q.propertyWithCounter should be set:", 32, q.propertyWithCounter)
    }

}
package iii_properties

import junit.framework.Assert
import org.junit.Test as test

class _18_Properties {
    test fun testPropertyWithCounter() {
        val q = PropertyExample()
        q.propertyWithCounter = 14
        q.propertyWithCounter = 21
        q.propertyWithCounter = 32
        Assert.assertEquals("The property q.changeCounter should contain the number of assignments to q.propertyWithCounter:",
                3, q.counter)
        // Here we have to use !! due to false smart cast impossible
        Assert.assertEquals("The property q.propertyWithCounter should be set:", 32, q.propertyWithCounter!!)
    }

}
Build fix: workaround for false smart cast impossible
Build fix: workaround for false smart cast impossible

xcerx/kotlin-koans,timbotetsu/kotlin-koans,RomanBelkov/workshop-jb,sarvex/workshop-jb,goodwinnk/workshop-jb,chickenbane/workshop-jb,jghoman/workshop-jb,sarvex/kotlin-koans,griffio/workshop-jb,usommerl/kotlin-koans,ian-pi/kotlin-koans,aksiksi/workshop-jb,ian-pi/kotlin-koans,mvaldez/kotlin-examples,sarvex/kotlin-koans,enchf/kotlin-koans,sleberknight/kotlin-koans,annekellyc/kotlin-koans,jghoman/workshop-jb,thatadamedwards/kotlin-koans,chrisdoc/kotlin-koans,rpandey1234/kotlin-koans,verhoevenv/kotlin-koans,thatadamedwards/kotlin-koans,sunghwanJo/workshop-jb,hughandrewarch/kotlin-koans,FaustXVI/kotlin-koans,marc-inn/learning-kotlin-from-jb,timbotetsu/kotlin-koans,eviera/kotlin-koans,SteveChalker/kotlin-koans,kozake/kotlin-koans,fnouama/workshop-jb,jvsegarra/kotlin-koans,verhoevenv/kotlin-koans,ncruz8991/kotlin-koans,JetBrains/workshop-jb,ncruz8991/kotlin-koans,eviera/kotlin-koans,aksiksi/workshop-jb,michael-johansen/workshop-jb,andersschuller/workshop-jb,tobydigz/androidkotlin,Kotlin/kotlin-koans,wickedwukong/kotlin-koans,zlsun/kotlin-koans,xcerx/kotlin-koans,sunghwanJo/workshop-jb,BryanJacobs/workshop-jb,Jachu5/Koans,alapshin/workshop-jb,marc-inn/learning-kotlin-from-jb,Riccorl/kotlin-koans,usommerl/kotlin-koans,griffio/workshop-jb,chrisdoc/kotlin-koans,michael-johansen/workshop-jb,mustafa01ali/workshop-jb,RomanBelkov/workshop-jb,jasonmfehr/kotlin-koans,jensim/kotlin-koans,hughandrewarch/kotlin-koans,jensim/kotlin-koans,Carighan/kotlin-koans,wickedwukong/kotlin-koans,enchf/kotlin-koans,annekellyc/kotlin-koans,mustafa01ali/workshop-jb,mvaldez/kotlin-examples,alapshin/workshop-jb,yamamotoj/workshop-jb,Yusuzhan/kotlin-koans,jasonmfehr/kotlin-koans,kozake/kotlin-koans,zyallday/kotlin-koans,fnouama/workshop-jb,rpandey1234/kotlin-koans,Yusuzhan/kotlin-koans,Kotlin/kotlin-koans,sleberknight/kotlin-koans,zyallday/kotlin-koans,myoffe/kotlin-koans,trmollet/tuto_kotlin,nakih/kotlin-koans,SteveChalker/kotlin-koans,vitaliy555/stdkotlin,MichaelEvans/kotlin-koans,vitaliy555/stdkotlin,zlsun/kotlin-koans,johnnywey/kotlin-koans,johnnywey/kotlin-koans,tobydigz/androidkotlin,TheCoinTosser/Kotlin-Koans---Solutions,BryanJacobs/workshop-jb,MichaelEvans/kotlin-koans,Carighan/kotlin-koans,AlexKrupa/kotlin-koans,chickenbane/workshop-jb,sarvex/workshop-jb,TheCoinTosser/Kotlin-Koans---Solutions,jvsegarra/kotlin-koans,JetBrains/workshop-jb,andersschuller/workshop-jb,Riccorl/kotlin-koans,myoffe/kotlin-koans,trmollet/tuto_kotlin,goodwinnk/workshop-jb,nakih/kotlin-koans,FaustXVI/kotlin-koans,Jachu5/Koans,AlexKrupa/kotlin-koans,yamamotoj/workshop-jb