Skip to content

Commit 36e8f4f

Browse files
Add MockViewController
1 parent a652ac8 commit 36e8f4f

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

Tests/UICoreTests/ViewControllerTests.swift

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,32 @@ final class ViewControllerTests: XCTestCase {
3939
XCTAssertEqual(sut.title, "Title")
4040
}
4141
}
42+
43+
final class MockViewController: ViewController {
44+
var modalPresentationStyleGetter: () -> ModalPresentationStyle = {
45+
XCTFail("Not implemented")
46+
return .automatic
47+
}
48+
49+
var modalPresentationStyleSetter: (ModalPresentationStyle) -> Void = { _ in
50+
XCTFail("Not implemented")
51+
}
52+
53+
var viewDidLoadBlock: () -> Void = {
54+
XCTFail("Not implemented")
55+
}
56+
57+
override var modalPresentationStyle: ModalPresentationStyle {
58+
get {
59+
return modalPresentationStyleGetter()
60+
}
61+
set {
62+
modalPresentationStyleSetter(newValue)
63+
}
64+
}
65+
66+
override func viewDidLoad() {
67+
super.viewDidLoad()
68+
viewDidLoadBlock()
69+
}
70+
}

0 commit comments

Comments
 (0)