9
9
import XCTest
10
10
import Stevia
11
11
12
- class GetConstraintsTests : XCTestCase {
12
+ @ MainActor class GetConstraintsTests : XCTestCase {
13
13
14
14
var v : UIView !
15
15
var spv : UIView !
16
16
17
- override func setUp( ) {
18
- spv = UIView ( )
19
- v = UIView ( )
17
+ override func setUp( ) async throws {
18
+ spv = await UIView ( )
19
+ v = await UIView ( )
20
20
spv. subviews { v! }
21
21
}
22
22
@@ -68,7 +68,7 @@ class GetConstraintsTests: XCTestCase {
68
68
XCTAssertEqual ( c? . isActive, true )
69
69
}
70
70
71
- func testCanGetBottomConstraint( ) {
71
+ @ MainActor func testCanGetBottomConstraint( ) {
72
72
XCTAssertNil ( v. bottomConstraint)
73
73
v. bottom ( 145 )
74
74
let c = v. bottomConstraint
@@ -84,7 +84,7 @@ class GetConstraintsTests: XCTestCase {
84
84
XCTAssertEqual ( c? . isActive, true )
85
85
}
86
86
87
- func testCanGetHeightConstraint( ) {
87
+ @ MainActor func testCanGetHeightConstraint( ) {
88
88
XCTAssertNil ( v. heightConstraint)
89
89
v. height ( 35 )
90
90
let c = v. heightConstraint
@@ -100,7 +100,7 @@ class GetConstraintsTests: XCTestCase {
100
100
XCTAssertEqual ( c? . isActive, true )
101
101
}
102
102
103
- func testCanGetWidthConstraint( ) {
103
+ @ MainActor func testCanGetWidthConstraint( ) {
104
104
XCTAssertNil ( v. widthConstraint)
105
105
v. width ( 51 )
106
106
let c = v. widthConstraint
@@ -116,7 +116,7 @@ class GetConstraintsTests: XCTestCase {
116
116
XCTAssertEqual ( c? . isActive, true )
117
117
}
118
118
119
- func testCanGetTrailingConstraint( ) {
119
+ @ MainActor func testCanGetTrailingConstraint( ) {
120
120
XCTAssertNil ( v. trailingConstraint)
121
121
v. trailingAnchor. constraint ( equalTo: spv. trailingAnchor, constant: 104 ) . isActive = true
122
122
let c = v. trailingConstraint
@@ -132,7 +132,7 @@ class GetConstraintsTests: XCTestCase {
132
132
XCTAssertEqual ( c? . isActive, true )
133
133
}
134
134
135
- func testCanGetLeadingonstraint( ) {
135
+ @ MainActor func testCanGetLeadingonstraint( ) {
136
136
XCTAssertNil ( v. leadingConstraint)
137
137
v. leadingAnchor. constraint ( equalTo: spv. leadingAnchor, constant: 73 ) . isActive = true
138
138
let c = v. leadingConstraint
@@ -148,7 +148,7 @@ class GetConstraintsTests: XCTestCase {
148
148
XCTAssertEqual ( c? . isActive, true )
149
149
}
150
150
151
- func testCanGetCenterXConstraint( ) {
151
+ @ MainActor func testCanGetCenterXConstraint( ) {
152
152
XCTAssertNil ( v. centerXConstraint)
153
153
v. CenterX == spv. CenterX + 27
154
154
let c = v. centerXConstraint
@@ -164,7 +164,7 @@ class GetConstraintsTests: XCTestCase {
164
164
XCTAssertEqual ( c? . isActive, true )
165
165
}
166
166
167
- func testCanGetCenterYConstraint( ) {
167
+ @ MainActor func testCanGetCenterYConstraint( ) {
168
168
XCTAssertNil ( v. centerYConstraint)
169
169
v. CenterY == spv. CenterY - 32
170
170
let c = v. centerYConstraint
0 commit comments