Skip to content

Instantly share code, notes, and snippets.

@heoblitz
Created September 27, 2021 09:19
testNavigation.swift
func testNavigation_whenButtonTapped_shouldPushDetailViewController() throws {
// Given
let nc = UINavigationController(rootViewController: sut)
sut.loadViewIfNeeded()
let button = sut.button
// When
button?.sendActions(for: .touchUpInside)
RunLoop.current.run(until: Date()) // 1
// Then
XCTAssertEqual(nc.viewControllers.count, 2) // 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment