@@ -12,19 +12,20 @@ import XCTest
12
12
class CGRect_AreaTests : XCTestCase {
13
13
14
14
let rect = CGRect ( x: 0 , y: 0 , width: 100 , height: 100 )
15
-
15
+
16
16
func test_whenCornersHavePadding( ) {
17
- XCTAssertEqual ( rect. area ( corner: SourceViewCorner ( point: CGPoint ( x: 10 , y: 10 ) , position: . topLeft) ) , 100 )
18
- XCTAssertEqual ( rect. area ( corner: SourceViewCorner ( point: CGPoint ( x: 90 , y: 10 ) , position: . topRight) ) , 100 )
19
- XCTAssertEqual ( rect. area ( corner: SourceViewCorner ( point: CGPoint ( x: 90 , y: 90 ) , position: . bottomRight) ) , 100 )
20
- XCTAssertEqual ( rect. area ( corner: SourceViewCorner ( point: CGPoint ( x: 10 , y: 90 ) , position: . bottomLeft) ) , 100 )
17
+
18
+ XCTAssertEqual ( rect. area ( corner: SourceViewCorner ( rect: CGRect ( x: 10 , y: 10 , width: 0 , height: 0 ) , position: . topLeft) ) , 100 )
19
+ XCTAssertEqual ( rect. area ( corner: SourceViewCorner ( rect: CGRect ( x: 90 , y: 10 , width: 0 , height: 0 ) , position: . topRight) ) , 100 )
20
+ XCTAssertEqual ( rect. area ( corner: SourceViewCorner ( rect: CGRect ( x: 90 , y: 90 , width: 0 , height: 0 ) , position: . bottomRight) ) , 100 )
21
+ XCTAssertEqual ( rect. area ( corner: SourceViewCorner ( rect: CGRect ( x: 10 , y: 90 , width: 0 , height: 0 ) , position: . bottomLeft) ) , 100 )
21
22
}
22
23
23
24
func test_whenCornersHaveNoPadding( ) {
24
- XCTAssertEqual ( rect. area ( corner: SourceViewCorner ( point : CGPoint ( x: 0 , y: 0 ) , position: . topLeft) ) , 0 )
25
- XCTAssertEqual ( rect. area ( corner: SourceViewCorner ( point : CGPoint ( x: 100 , y: 0 ) , position: . topRight) ) , 0 )
26
- XCTAssertEqual ( rect. area ( corner: SourceViewCorner ( point : CGPoint ( x: 100 , y: 100 ) , position: . bottomRight) ) , 0 )
27
- XCTAssertEqual ( rect. area ( corner: SourceViewCorner ( point : CGPoint ( x: 00 , y: 100 ) , position: . bottomLeft) ) , 0 )
25
+ XCTAssertEqual ( rect. area ( corner: SourceViewCorner ( rect : CGRect ( x: 0 , y: 0 , width : rect . width , height : rect . height ) , position: . topLeft) ) , 0 )
26
+ XCTAssertEqual ( rect. area ( corner: SourceViewCorner ( rect : CGRect ( x: 100 , y: 0 , width : rect . width , height : rect . height ) , position: . topRight) ) , 0 )
27
+ XCTAssertEqual ( rect. area ( corner: SourceViewCorner ( rect : CGRect ( x: 100 , y: 100 , width : rect . width , height : rect . height ) , position: . bottomRight) ) , 0 )
28
+ XCTAssertEqual ( rect. area ( corner: SourceViewCorner ( rect : CGRect ( x: 0 , y: 100 , width : rect . width , height : rect . height ) , position: . bottomLeft) ) , 0 )
28
29
}
29
-
30
+
30
31
}
0 commit comments