If you've been following us for a while, you know we recommend you test your code.
In fact, we highly recommend you practice Test-Driven Development and write the tests first.
And if you've been taking our advice, you probably faced a bunch of code that's hard to test.
Maybe because you're dealing with legacy code that was built with no testability in mind.
Or you're dealing with some 3rd-party frameworks or infrastructure that's unreliable, like databases and backend APIs.
You may also feel stuck wondering if you've tested your code enough or even if you've tested your code too much.
In this podcast, we present practical solutions to 12 common challenges you'll face when writing a test suite for your iOS/Swift apps. Including:
"How to test random values without mocking the random algorithm?"
"How to test code that asynchronously dispatches work to the main `DispatchQueue`?"
"How can I test code that depends on the current Date and Time?"
"How to test if a `UITextField` is focused? I can't check that it becomes the first responder in unit tests - `isFirstResponder` always returns `false`"
"How to test parts of the app that uses Firebase?"
"How to test StoreKit?"
"How to test Sign in with Apple?"
"How to test a `UIImageView` of a `UITableViewCell` that fetches an image from a URL using SDWebImage?"
"I have an `AlertControl` class to present alerts in my app. How to test that the `AlertControl` shared instance displays the alert on certain UI events?"
"How to test that a component is storing values in `UserDefaults` correctly?"
We highly recommend you watch or listen to this podcast. You'll learn fast and reliable ways to validate code that's hard to test and deliver better apps with confidence.
Like and share this content with someone that you believe will benefit from it. See you in the next episode.
Testing code that uses DispatchQueue.main.async↴
https://www.essentialdeveloper.com/ar...
Testing Date Span in Swift: Controlling the current date & time↴
https://www.essentialdeveloper.com/ar...
iOS Dev Mentoring #008: Test-driven MVVM with RxSwift↴
https://www.essentialdeveloper.com/io...
3 Steps to Prepare Your Apps for SwiftUI, Combine, iPadOS, Project Catalyst, and Any Other Leaps in the iOS Industry↴
https://www.essentialdeveloper.com/ar...
How to Build iOS Apps with Swift, TDD & Clean Architecture series↴
https://www.essentialdeveloper.com/pr...
Caio & Mike's Book Suggestions ↴
https://www.essentialdeveloper.com/bo...
---
Subscribe to our channel ↴
https://www.youtube.com/essentialdeve...
You can also find us on ↴
Twitter ☛ / essentialdevcom
Facebook ☛ / essentialdeveloper
Instagram ☛ / essentialdeveloper
Caio ↴
Twitter ☛ / caiozullo
LinkedIn ☛ / caiozullo
Mike ↴
Twitter ☛ / mrmichael
LinkedIn ☛ / mapostolakis
Join the iOS Lead Essentials program ↴
https://iosleadessentials.com
Visit our website ↴
https://essentialdeveloper.com