Moyuru Aizawa
September 30, 2016
500

# Kotlin for Test

テストにKotlinを導入した

## Moyuru Aizawa

September 30, 2016

## Transcript

4. None

6. ### ,PUMJO ‣ +FU#SBJOT ‣ ੩తܕ෇͚ ‣ ΦϒδΣΫτࢦ޲ ‣ GPS+7. "OESPJEBOECSPXTFS

‣ #FUUFS+BWB ‣ +BWBͱͷ૬ޓӡ༻ੑ ‣ +BWBͱಉ౳ʹ଎͍ίϯύΠϧϥϯλΠϜ
7. ### ‣ +BWBʹൺ΂ͯগͳ͍هड़ྔ ‣ +BWBʹ͸ແ͍๛෋ͳػೳ ‣ ϓϩύςΟ ‣ ҕৡϓϩύςΟ ‣ ֦ுؔ਺

‣ σϑΥϧτҾ਺໊લ෇͖Ҿ਺ ‣ ؔ਺Ϧςϥϧ ‣ ߴ֊ؔ਺ ,PUMJOͷ͍͍ͱ͜Ζ

11. ### ‣ ϓϩμΫτ͸+BWBͷ·· ‣ ςετίʔυͷஈ֊Ͱ,PUMJOΛ͍֮͑ͯ͘ ‣ "DUJWJUZͷίʔυϨϏϡʔΑΓςετͷίʔυϨϏϡʔͷָ͕ ‣ ࣄલʹߦͬͨ,PUMJOษڧձ ˢͰڭ͍͑ͯ͘ ‣

ϓϩμΫτʹಋೖ͢Δͱͯ͠ɺͦͷࠒʹ͸ϝϯόʔશһ͕ॻ͚Δঢ়ଶ ʹͳΔ ‣ ͔͠΋ɺςετίʔυͷهड़ྔ΋ݮָͬͯ ςετʹಋೖ
12. ### ‣ ͓΋ΉΖʹzOFX,PUMJO'JMF\$MBTTz ‣ "OESPJE4UVEJP PS*OUFMMJ+ ͕ʮ,PUMJOͷઃఆͯ͠ͳ͍͚Ͳ͢Δ ʯ  ͱ͖͍ͯ͘Δ ‣ l0,z

‣ Α͠ͳʹ΍ͬͯ͘ΕΔ ‣ ૉఢ ಋೖํ๏

14. ### %BP val expectedList = Array(10) { User(it, "name\$it") }.toList() orma.prepareInsertIntoUser().executeAll(expectedList)

val actualList = dao.findAll() actualList.size.should be expectedLis.size actualList.forEachIndexed { i, actual -> actual.should be expectedList[i] } final List<User> expectedList = new ArrayList(); for(int i = 0; i < 10; i++) { expectedList.add( new User(i, "name"+i) ); } orma.prepareInsertIntoUser().executeAll(expectedList); final List<User> actualList = dao.findAll() assertTha(actualList.size(), is(expectedList.size())); for(int i = 0, i < actualList.size(), i++) { assertThat(actualList.get(i), is(expectedList.get(i))); } +BWB ,PUMJO
15. ### %BP Array(10) { User().apply { id = it.toLong() name =

"name\$it" age = it height = it weight = it birthDay = date }}.toList() for(int i = 0; i < 10; i++) { User user = new User(); user.setId(i); user.setName("name" + i); user.serAge(i); user.setHeight(i); user.setWeight(i); user.setBirthDay(date); } +BWB ,PUMJO
16. ### .PDL val client: FooClient = mock() client.fetch().invoked.thenReturn( Observable.just(expected) ) final

Client client = mock(FooClient::class); when(client.fetch()).thenReturn(Observable.just(expected)); +BWB ,PUMJO