We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If my UI was being created by code, how would I go about testing the output in the view controller?
The text was updated successfully, but these errors were encountered:
You can do it something like below
class MyViewControllerTests: XCTestCase { // MARK: - Subject under test
var sut: MyViewController! var window: UIWindow! // MARK: - Test lifecycle override func setUp() { super.setUp() window = UIWindow() setupMyViewController() } override func tearDown() { window = nil super.tearDown() } // MARK: - Test setup func setupMyViewController() { sut = MyViewController.instance() loadView() addViewToWindow() } func loadView() { let _ = sut.view } func addViewToWindow() { window.addSubview(sut.view) RunLoop.current.run(until: Date() as Date) } // MARK: - Test doubles // MARK: - Tests
...
}
Sorry, something went wrong.
No branches or pull requests
If my UI was being created by code, how would I go about testing the output in the view controller?
The text was updated successfully, but these errors were encountered: