title: How can I test that a view controller has been presented?
body: <p>I'm trying to write a unit test that a view controller is presented once a row is selected. The cell declaration doesn't work, because for some reason you can't call didSelectRow on the tableview. Also, I get an error that presentedVC is nil:</p>
  
  <pre><code>func testDidSelectNewsReportCalledWhenNewsReportSelected() {
      var cell = tableView.didSelectRow(at: IndexPath(row: 0, section: 3), animated: false) //This line doesn't work
  
     let presentedVC = controller.presentedViewController?.view
      let newsReportVC = UIStoryboard(name:"News", bundle: Bundle.init(for: NewsViewController.self)).instantiateViewController(withIdentifier: "NewsReport") as! NewsReportViewController
      XCTAssertEqual(newsReportVC, presentedVC)
  }
  </code></pre>
  
  <p>Thanks.</p>