unit and acceptance testing, automation, productivity

Posts tagged "XCTest"

How to remove duplication from Swift tests with helper functions

Some code ends up requiring a lot of duplication to be tested. You can remove it by using helper functions encapsulating the shared assertion logic.

XCTest closure based expectations

Testing async code is not simple, but XCTest provides us with all the required tool. This post shows how to wait for an expectation to be fulfilled based on a Swift closure.

Testing Delegates in Swift with XCTest

In this second post of the Practical Testing in Swift we a look at strategies to test how objects call their delegate methods or set property on them.

Testing callbacks in Swift with XCTest

Better tests with Specta

Writing unit tests for our iOS and OS X projects not only is important, but should be always part of the development cycle. As such the way we write the tests is as important, and having the option to write tests that easily explain their purpose can drastically increase the quality of the suite. Specta and Expecta are two libraries that provide a different way to writing tests than XCTest, let's see what we can gain by using such approach.