Upgrade to Pro — share decks privately, control downloads, hide ads and more …

RxSwiftのテスト入門

100059
April 16, 2019

 RxSwiftのテスト入門

RxSwiftのコードへのテストの書き方の流れ

100059

April 16, 2019
Tweet

More Decks by 100059

Other Decks in Technology

Transcript

  1. 7JFX ඳը 7JFX.PEFM ϩδοΫ ςΩετೖྗ Ϙλϯͷ &OBCMF ߦະຬ ˠ'BMTF ̏ߦҎ্

    ˠ5SVF RxSwiftΛ࢖ͬͨMVVMͰͷVM૚ʹςετΛॻ͘͜ͱΛ૝ఆ
  2. 7JFX ඳը 7JFX.PEFM ϩδοΫ ςΩετೖྗ Ϙλϯͷ &OBCMF ߦະຬ ˠ'BMTF ̏ߦҎ্

    ˠ5SVF ୯ମςετͰ͖ͦ͏ʁʁ RxSwiftΛ࢖ͬͨMVVMͰͷVM૚ʹςετΛॻ͘͜ͱΛ૝ఆ
  3. 7JFX ඳը 7JFX.PEFM ϩδοΫ ςΩετೖྗ Ϙλϯͷ &OBCMF ߦະຬ ˠ'BMTF ̏ߦҎ্

    ˠ5SVF ୯ମςετͰ͖ͦ͏ʁʁ RxSwiftΛ࢖ͬͨMVVMͰͷVM૚ʹςετΛॻ͘͜ͱΛ૝ఆ
  4. 7JFX ඳը 7JFX.PEFM ϩδοΫ 0CTFSWBCMF4USJOH 0CTFSWBCMF#PPM ςΩετೖྗ Ϙλϯͷ &OBCMF 

       ' ' 5 5 0CTFSWBCMF͸Ұ࿈ͷ஋ͷྲྀΕ ετϦʔϜ Ͱ͋Γɺ ୯Ұͷ஋ͱͯ͠ςετ͢Δ͜ͱ͕ࠔ೉
  5. 7JFX ඳը 7JFX.PEFM ϩδοΫ 0CTFSWBCMF4USJOH 0CTFSWBCMF#PPM ςΩετೖྗ Ϙλϯͷ &OBCMF 

       ' ' 5 5 ʲ*OQVUʳΠϕϯτͷ࣌ؒͱ஋Λࢦఆͯ͠ɺ 0CTFSWBCMFʹ஋Λྲྀ͢͜ͱ͕ࠔ೉
  6. 7JFX ඳը 7JFX.PEFM ϩδοΫ 0CTFSWBCMF4USJOH 0CTFSWBCMF#PPM ςΩετೖྗ Ϙλϯͷ &OBCMF 

       ' ' 5 5 ʲ0VUQVUʳྲྀΕͨΠϕϯτͷ࣌ؒͱ஋Λ ·ͱΊͯऔಘ͢Δ͜ͱ͕ࠔ೉
  7. 7JFX ඳը 7JFX.PEFM ϩδοΫ 0CTFSWBCMF4USJOH 0CTFSWBCMF#PPM ςΩετೖྗ Ϙλϯͷ &OBCMF 

       ' ' 5 5 ࣮࣌ؒͰಈ͍͍ͯΔͨΊɺ ςετʹ͕͔͔࣌ؒͬͯ͠·͏ɻ
  8. Recorded /// Record of a value including the virtual time

    it was produced on. public struct Recorded<Value>: CustomDebugStringConvertible { /// Gets the virtual time the value was produced on. public let time: TestTime /// Gets the recorded value. public let value: Value public init(time: TestTime, value: Value) { self.time = time self.value = value } } ΠϕϯτͰੜ੒͞Εͨ஋ͱ ஋͕ੜ੒͞ΕͨԾ૝࣌ؒΛอ࣋ɻ