Jera Docs

Documents, reminders and "cheat sheets" I use in everyday development

View the Project on GitHub jeradesign/jeradoc

iOS Unit Testing Cheat Sheet

D’oh!

Did you, by any chance, name your test method text_something instead of test_something?

Concepts

CustomStringConvertible

Implement CustomStringConvertible protocol and add a “description” method.

Asserts

Testing a class

@testable import AppTarget

class MyClassTests: XCTestCase {
    func test_methodOne() {
    }
}

Testing View Controllers

loadViewIfNeeded()

Tips

Turn off debugging for unit tests to speed up.