Skip to content

Commit 6b9c15d

Browse files
Rename sut to vc
1 parent f86e932 commit 6b9c15d

File tree

1 file changed

+33
-33
lines changed

1 file changed

+33
-33
lines changed

Tests/UICoreTests/ViewControllerTests.swift

+33-33
Original file line numberDiff line numberDiff line change
@@ -6,102 +6,102 @@ import XCTest
66

77
final class ViewControllerTests: XCTestCase {
88
func testLazyViewLoading() {
9-
let sut = ViewController()
9+
let vc = ViewController()
1010

11-
XCTAssertNil(sut.viewIfLoaded)
12-
XCTAssertFalse(sut.isViewLoaded)
11+
XCTAssertNil(vc.viewIfLoaded)
12+
XCTAssertFalse(vc.isViewLoaded)
1313

14-
_ = sut.view
14+
_ = vc.view
1515

16-
XCTAssertNotNil(sut.viewIfLoaded)
17-
XCTAssertTrue(sut.isViewLoaded)
16+
XCTAssertNotNil(vc.viewIfLoaded)
17+
XCTAssertTrue(vc.isViewLoaded)
1818
}
1919

2020
func testManualViewLoading() {
21-
let sut = ViewController()
21+
let vc = ViewController()
2222

23-
XCTAssertNil(sut.viewIfLoaded)
24-
XCTAssertFalse(sut.isViewLoaded)
23+
XCTAssertNil(vc.viewIfLoaded)
24+
XCTAssertFalse(vc.isViewLoaded)
2525

26-
sut.loadViewIfNeeded()
26+
vc.loadViewIfNeeded()
2727

28-
XCTAssertNotNil(sut.viewIfLoaded)
29-
XCTAssertTrue(sut.isViewLoaded)
28+
XCTAssertNotNil(vc.viewIfLoaded)
29+
XCTAssertTrue(vc.isViewLoaded)
3030
}
3131

3232
func testTitleGetterAndSetter() {
33-
let sut = ViewController()
33+
let vc = ViewController()
3434

35-
// XCTAssertNil(sut.title) // This is currently failing, but the initial value of `title` should be `nil`
35+
// XCTAssertNil(vc.title) // This is currently failing, but the initial value of `title` should be `nil`
3636

37-
sut.title = "Title"
37+
vc.title = "Title"
3838

39-
XCTAssertEqual(sut.title, "Title")
39+
XCTAssertEqual(vc.title, "Title")
4040
}
4141

4242
func testValueOfDisablesAutomaticKeyboardDismissal() {
43-
let sut = MockViewController()
43+
let vc = MockViewController()
4444

45-
sut.modalPresentationStyleGetter = {
45+
vc.modalPresentationStyleGetter = {
4646
return .automatic
4747
}
4848

49-
XCTAssertFalse(sut.disablesAutomaticKeyboardDismissal)
49+
XCTAssertFalse(vc.disablesAutomaticKeyboardDismissal)
5050

51-
sut.modalPresentationStyleGetter = {
51+
vc.modalPresentationStyleGetter = {
5252
return .formSheet
5353
}
5454

55-
XCTAssertTrue(sut.disablesAutomaticKeyboardDismissal)
55+
XCTAssertTrue(vc.disablesAutomaticKeyboardDismissal)
5656
}
5757

5858
func testNextResponder() {
5959
let expectedResult = View(frame: .zero)
6060

61-
let sut = ViewController()
61+
let vc = ViewController()
6262

63-
XCTAssertNil(sut.next)
63+
XCTAssertNil(vc.next)
6464

65-
expectedResult.addSubview(sut.view)
65+
expectedResult.addSubview(vc.view)
6666

67-
XCTAssert(sut.next === expectedResult)
67+
XCTAssert(vc.next === expectedResult)
6868
}
6969

7070
func testViewDidLoadMethodCalledAfterLazyViewLoad() {
71-
let sut = MockViewController()
71+
let vc = MockViewController()
7272

7373
let expectation = self.expectation(description: "viewDidLoad should be called")
7474

75-
sut.viewDidLoadBlock = {
75+
vc.viewDidLoadBlock = {
7676
expectation.fulfill()
7777
}
7878

79-
_ = sut.view
79+
_ = vc.view
8080

8181
wait(for: [expectation], timeout: 0.1)
8282
}
8383

8484
func testViewDidLoadMethodCalledAfterManualViewLoad() {
85-
let sut = MockViewController()
85+
let vc = MockViewController()
8686

8787
let expectation = self.expectation(description: "viewDidLoad should be called")
8888

89-
sut.viewDidLoadBlock = {
89+
vc.viewDidLoadBlock = {
9090
expectation.fulfill()
9191
}
9292

93-
sut.loadViewIfNeeded()
93+
vc.loadViewIfNeeded()
9494

9595
wait(for: [expectation], timeout: 0.1)
9696
}
9797

9898
func testViewDidLoadMethodNotCalledIfViewNotLoaded() {
99-
let sut = MockViewController()
99+
let vc = MockViewController()
100100

101101
let expectation = self.expectation(description: "viewDidLoad should not be called")
102102
expectation.isInverted = true
103103

104-
sut.viewDidLoadBlock = {
104+
vc.viewDidLoadBlock = {
105105
expectation.fulfill()
106106
}
107107

0 commit comments

Comments
 (0)