Write better Unit tests with XCTUnwrap
Testing optionals can require boilerplate code to unwrap it. It can also affect the readability of the test. Let's look...
Testing optionals can require boilerplate code to unwrap it. It can also affect the readability of the test. Let's look...
One of the main issues we are facing when we try to make an old piece of code testable is...
Finally Apple (iOS 13 +) has added constructor dependency injection to Storyboards! No excuses anymore for not using DI properly...
One way of testing code with DispatchQueue is by using expectations (https://developer.apple.com/documentation/xctest/asynchronous_tests_and_expectations/testing_asynchronous_operations_with_expectations) but in most of the cases it's more...
Unit testing UIViewController life cycle events are not a straightforward process. Let's have a look on the following view controller:...
UIViewControllers are among the most used UIKit objects. As the name implies UIViewControllers are controller objects and their purpose should...
In this article, we will see how we can test code that post notifications. Let's see our example code: ...
In this article, we will see how we can test code that interacts with the NotificationCenter. The Observer pattern is...
In this article, we will see how to test Result types and closures. To keep it simple, we will use...