SHARE
TWEET

Untitled

a guest Mar 25th, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import Quick
  2. import Nimble
  3. @testable import UnitTestPractical
  4.  
  5. class SampleListViewControllerTest: QuickSpec {
  6.     override func spec() {
  7.         var viewController: SampleListViewController!
  8.         var repository: SampleRepository!
  9.        
  10.         beforeEach {
  11.             repository = SampleRepository()
  12.             viewController = SampleListViewController.createVC(repository)
  13.         }
  14.        
  15.         describe("viewDidLoad") {
  16.             beforeEach {
  17.                 let _ =  viewController.view
  18.             }
  19.             it("RxDataSource Table rows") {
  20.                 let firstCell = viewController.dataSource.tableView(viewController.tableView, cellForRowAt: IndexPath(row: 0, section: 0)) as? SampleItemCell
  21.                 expect(firstCell?.titleView.text).toEventually(equal("aaa"))
  22.             }
  23.         }
  24.     }
  25. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top