@@ -21,7 +21,7 @@ final class PlayButtonTests: XCTestCase {
21
21
windowView = vc. view
22
22
23
23
SnapshotTesting . diffTool = " ksdiff "
24
- // isRecording = true
24
+ // isRecording = true
25
25
}
26
26
27
27
func testPlayToPause( ) {
@@ -225,6 +225,60 @@ final class PlayButtonTests: XCTestCase {
225
225
button. setStop ( true , animated: false )
226
226
XCTAssertEqual ( button. isStop, true )
227
227
}
228
+
229
+ func testScaleAspectFillWidthGreaterThanHeight( ) {
230
+ let button = PlayButton ( frame: CGRect ( x: 0 , y: 0 , width: 60 , height: 30 ) )
231
+ button. backgroundColor = . blue
232
+ button. contentMode = . scaleAspectFill
233
+
234
+ windowView. addSubview ( button)
235
+ assertSnapshot ( matching: button, as: . image)
236
+ }
237
+
238
+ func testScaleAspectFillHeightGreaterThanWidth( ) {
239
+ let button = PlayButton ( frame: CGRect ( x: 0 , y: 0 , width: 30 , height: 60 ) )
240
+ button. backgroundColor = . blue
241
+ button. contentMode = . scaleAspectFill
242
+
243
+ windowView. addSubview ( button)
244
+ assertSnapshot ( matching: button, as: . image)
245
+ }
246
+
247
+ func testScaleAspectFitWidthGreaterThanHeight( ) {
248
+ let button = PlayButton ( frame: CGRect ( x: 0 , y: 0 , width: 60 , height: 30 ) )
249
+ button. backgroundColor = . blue
250
+ button. contentMode = . scaleAspectFit
251
+
252
+ windowView. addSubview ( button)
253
+ assertSnapshot ( matching: button, as: . image)
254
+ }
255
+
256
+ func testScaleAspectFitHeightGreaterThanWidth( ) {
257
+ let button = PlayButton ( frame: CGRect ( x: 0 , y: 0 , width: 30 , height: 60 ) )
258
+ button. backgroundColor = . blue
259
+ button. contentMode = . scaleAspectFit
260
+
261
+ windowView. addSubview ( button)
262
+ assertSnapshot ( matching: button, as: . image)
263
+ }
264
+
265
+ func testScaleToFillWidthGreaterThanHeight( ) {
266
+ let button = PlayButton ( frame: CGRect ( x: 0 , y: 0 , width: 60 , height: 30 ) )
267
+ button. backgroundColor = . blue
268
+ button. contentMode = . scaleToFill
269
+
270
+ windowView. addSubview ( button)
271
+ assertSnapshot ( matching: button, as: . image)
272
+ }
273
+
274
+ func testScaleToFillHeightGreaterThanWidth( ) {
275
+ let button = PlayButton ( frame: CGRect ( x: 0 , y: 0 , width: 30 , height: 60 ) )
276
+ button. backgroundColor = . blue
277
+ button. contentMode = . scaleToFill
278
+
279
+ windowView. addSubview ( button)
280
+ assertSnapshot ( matching: button, as: . image)
281
+ }
228
282
}
229
283
230
284
private enum CompletionCondition {
0 commit comments