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

ユニットテストを学んだ次に知りたかったApple標準APIに対するテストのやり方

Avatar for ojun ojun
June 04, 2023

 ユニットテストを学んだ次に知りたかったApple標準APIに対するテストのやり方

Avatar for ojun

ojun

June 04, 2023
Tweet

More Decks by ojun

Other Decks in Programming

Transcript

  1. σϞΞϓϦ֓ཁ • ొ࿥ͨ͠৘ใ͸UserDefaultsͰอଘ • ௥Ճ͞ΕͨλΠϛϯάͰ 
 UNUserNoti fi cationCenterʹ௥Ճ •

    ͪͳΈʹ 
 UNUserNoti fi cationCenterͷpendingRequest 
 Λ࢖͏Α͏ʹ͢Ε͹UserDefaultsʹอଘ͢Δඞཁ͸ 
 ͳ͘ͳΔ
  2. • UNUserNoti fi cationCenter.current()ΛMock͢Δ • Mock͢Δ͜ͱͰ • debug / production

    → UNUserNoti fi cationCenter.current() • test → Mockͨ͠Ϟϊ Ͳ͏͢Ε͹Α͔͔ͬͨ