Last active
November 4, 2016 15:20
-
-
Save sliskiCode/f9520a3bec10e367437df778abae052e to your computer and use it in GitHub Desktop.
Deep dive in Kotlin extensions 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.junit.Assert.assertEquals | |
import org.junit.Test | |
fun String.removeWhitespaces() = replace(" ", "") | |
class StringKtTest { | |
@Test fun removesWhitespacesFromString() { | |
val tested = "Piotr Slesarew" | |
val actual = tested.removeWhitespaces() | |
val expected = "PiotrSlesarew" | |
assertEquals(expected, actual) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment