Creating Tests

The WebViewTests class contains the same setUp, tearDown, testExample, and testPerformanceExample methods we saw in the other class. We can delete the latter two methods, since they’re just meant as examples and we will be writing our own.

Visibility Modifiers

What we need to do is to write a test method that can access the twitterWebView property of the ViewController class. This actually presents a little bit of a hassle that we haven’t had to consider before. Swift considers all the classes in the PragmaticTweets target to be one module, and classes in a module can see each other’s properties and methods by default. However, PragmaticTweetsTests is a different target and thus a different module, so it cannot see the methods or ...

Get iOS 8 SDK Development, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.