Kotlin for Test

5f533179da1c82722252cbcb93e7356f?s=47 Moyuru Aizawa
September 30, 2016

Kotlin for Test

テストにKotlinを導入した

TwitterID変えました。@lvla0805 -> @MoyuruAizawa

5f533179da1c82722252cbcb93e7356f?s=128

Moyuru Aizawa

September 30, 2016
Tweet

Transcript

  1. 4.
  2. 5.
  3. 6.

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

    ‣ #FUUFS+BWB ‣ +BWBͱͷ૬ޓӡ༻ੑ ‣ +BWBͱಉ౳ʹ଎͍ίϯύΠϧϥϯλΠϜ
  4. 7.

    ‣ +BWBʹൺ΂ͯগͳ͍هड़ྔ ‣ +BWBʹ͸ແ͍๛෋ͳػೳ ‣ ϓϩύςΟ ‣ ҕৡϓϩύςΟ ‣ ֦ுؔ਺

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

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

    ϓϩμΫτʹಋೖ͢Δͱͯ͠ɺͦͷࠒʹ͸ϝϯόʔશһ͕ॻ͚Δঢ়ଶ ʹͳΔ ‣ ͔͠΋ɺςετίʔυͷهड़ྔ΋ݮָͬͯ ςετʹಋೖ
  6. 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
  7. 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
  8. 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
  9. 18.