Advertisement
Guest User

Untitled

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