@@ -164,7 +164,7 @@ final class WidthSizeContentTests: XCTestCase {
164
164
XCTAssertEqual ( aView. frame, CGRect ( x: 0.0 , y: 0.0 , width: 400.0 , height: 200.0 ) )
165
165
}
166
166
167
- func test_gap_in_row_direction ( ) {
167
+ func test_set_gap_in_row_direction ( ) {
168
168
rootFlexContainer. flex. direction ( . row) . define { flex in
169
169
flex. addItem ( aView) . height ( 100 ) . width ( 100 )
170
170
flex. addItem ( bView) . height ( 100 ) . width ( 100 )
@@ -177,7 +177,7 @@ final class WidthSizeContentTests: XCTestCase {
177
177
XCTAssertEqual ( bView. frame, CGRect ( x: 150.0 , y: 0.0 , width: 100.0 , height: 100.0 ) )
178
178
}
179
179
180
- func test_gap_in_column_direction ( ) {
180
+ func test_set_gap_in_column_direction ( ) {
181
181
rootFlexContainer. flex. direction ( . column) . define { flex in
182
182
flex. addItem ( aView) . height ( 100 ) . width ( 100 )
183
183
flex. addItem ( bView) . height ( 100 ) . width ( 100 )
@@ -190,7 +190,7 @@ final class WidthSizeContentTests: XCTestCase {
190
190
XCTAssertEqual ( bView. frame, CGRect ( x: 0.0 , y: 150.0 , width: 100.0 , height: 100.0 ) )
191
191
}
192
192
193
- func test_gap_in_all_direction ( ) {
193
+ func test_set_gap_in_all_direction ( ) {
194
194
rootFlexContainer. flex. direction ( . column) . define { flex in
195
195
flex. addItem ( aView) . height ( 100 ) . width ( 100 )
196
196
flex. addItem ( bView) . height ( 100 ) . width ( 100 )
@@ -207,4 +207,55 @@ final class WidthSizeContentTests: XCTestCase {
207
207
XCTAssertEqual ( bView. frame, CGRect ( x: 0.0 , y: 150.0 , width: 100.0 , height: 100.0 ) )
208
208
XCTAssertEqual ( cView. frame, CGRect ( x: 150.0 , y: 0.0 , width: 100.0 , height: 100.0 ) )
209
209
}
210
+
211
+ func test_get_gap_in_row_direction( ) {
212
+ rootFlexContainer. flex. direction ( . row) . define { flex in
213
+ flex. addItem ( aView) . height ( 100 ) . width ( 100 )
214
+ flex. addItem ( bView) . height ( 100 ) . width ( 100 )
215
+ flex. alignItems ( . start)
216
+
217
+ flex. setGap ( . row, 20 )
218
+ }
219
+
220
+ rootFlexContainer. flex. layout ( )
221
+
222
+ let rowGap = rootFlexContainer. flex. getGap ( . row)
223
+
224
+ XCTAssertEqual ( rowGap, 20 )
225
+ }
226
+
227
+ func test_get_gap_in_column_direction( ) {
228
+ rootFlexContainer. flex. direction ( . column) . define { flex in
229
+ flex. addItem ( aView) . height ( 100 ) . width ( 100 )
230
+ flex. addItem ( bView) . height ( 100 ) . width ( 100 )
231
+ flex. alignItems ( . start)
232
+
233
+ flex. setGap ( . column, 20 )
234
+ }
235
+
236
+ rootFlexContainer. flex. layout ( )
237
+
238
+ let columnGap = rootFlexContainer. flex. getGap ( . column)
239
+
240
+ XCTAssertEqual ( columnGap, 20 )
241
+ }
242
+
243
+ func test_get_gap_in_all_direction( ) {
244
+ rootFlexContainer. flex. direction ( . column) . define { flex in
245
+ flex. addItem ( aView) . height ( 100 ) . width ( 100 )
246
+ flex. addItem ( bView) . height ( 100 ) . width ( 100 )
247
+ flex. addItem ( ) . direction ( . row) . define { flex in
248
+ flex. addItem ( cView) . height ( 100 ) . width ( 100 )
249
+ }
250
+ flex. alignItems ( . start)
251
+
252
+ flex. setGap ( . all, 20 )
253
+ }
254
+
255
+ rootFlexContainer. flex. layout ( )
256
+
257
+ let allGap = rootFlexContainer. flex. getGap ( . all)
258
+
259
+ XCTAssertEqual ( allGap, 20 )
260
+ }
210
261
}
0 commit comments