Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. // 1
  2. let viewModel = MockUpSampleViewModel()
  3. viewModel.isOn.silentUpdate(value: false)
  4. let sampleViewController = SampleViewController(viewModel: viewModel)
  5.  
  6. // When
  7. // 2
  8. _ = sampleViewController.view
  9. viewModel.isOn.value = true
  10. // 3
  11. let expectation = self.expectation(description: "testSwitchOn")
  12. DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(500)) {
  13. expectation.fulfill()
  14. }
  15.  
  16. // Then
  17. //4
  18. waitForExpectations(timeout: 1)
  19.  
  20. // 5
  21. XCTAssert(sampleViewController.switch.isOn == true)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement