Created
December 14, 2017 20:20
-
-
Save AlexeySoshin/55280836fd60aadc07aa05e6d18ae672 to your computer and use it in GitHub Desktop.
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
@org.testng.annotations.Test | |
fun FactoryMethodTest() { | |
// Cannot do this, constructor is private | |
// val arya = SecretiveGirl(); | |
val arya1 = SecretiveGirl.newGirl("Arry") | |
assertEquals(17, arya1.age) | |
assertEquals("Arry", arya1.name) | |
assertEquals("A girl has no desires", arya1.desires) | |
val arya2 = SecretiveGirl.newGirl("Cersei Lannister", "Joffrey", "Ilyn Payne") | |
assertEquals(17, arya2.age) | |
assertEquals("A girl has no name", arya2.name) | |
assertEquals("Cersei Lannister, Joffrey, Ilyn Payne", arya2.desires) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment