Unit testing UIView action and gesture in Swift
['Benoit Pasquier']
Benoit Pasquier - Swift, Data and more
viewModel = viewModel } lazy var checkoutView : UIView = { let label = UILabel () label . centerXAnchor ) ]) return view }() private lazy var checkoutTapGesture = UITapGestureRecognizer ( target : self , action : #selector ( tapCheckout )) @objc private func tapCheckout () { viewModel . centerXAnchor ) ]) return view }() private lazy var checkoutSwipeGesture : UISwipeGestureRecognizer = UISwipeGestureRecognizer ( target : self , action : #selector ( swipeCheckout )) // ViewControllerTests func test_swipe_checkout () { // Given: let swipeCheckoutExpectation = expectation ( description : #function ) XCTAssertEqual ( viewModel .