Skip to content

Commit 69dcbaa

Browse files
author
Baris Sencan
committed
First steps towards a brighter future
1 parent 525299e commit 69dcbaa

File tree

2 files changed

+83
-2
lines changed

2 files changed

+83
-2
lines changed

ManualLayoutTests/FastAccessTests.swift

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,86 @@ import XCTest
1111
import ManualLayout
1212

1313
class FastAccessTests: XCTestCase {
14+
let view = UIView(frame: CGRectZero)
1415

16+
override func setUp() {
17+
view.frame = CGRectZero
18+
}
19+
20+
func testOrigin() {
21+
let origin = CGPoint(x: 10, y: 10)
22+
view.origin = origin
23+
XCTAssertEqual(view.frame.origin, origin, "origin changes should modify frame origin")
24+
XCTAssertEqual(view.frame.size, CGSizeZero, "origin changes should not modify frame size")
25+
}
26+
27+
func testX() {
28+
view.x = 10
29+
XCTAssertEqual(view.frame.origin, CGPoint(x: 10, y: 0), "x changes should just modify frame x")
30+
XCTAssertEqual(view.frame.size, CGSizeZero, "x changes should not modify frame size")
31+
}
32+
33+
func testY() {
34+
view.y = 10
35+
XCTAssertEqual(view.frame.origin, CGPoint(x: 0, y: 10), "y changes should just modify frame y")
36+
XCTAssertEqual(view.frame.size, CGSizeZero, "y changes should not modify frame size")
37+
}
38+
39+
func testCenter() {
40+
41+
}
42+
43+
func testCenterX() {
44+
45+
}
46+
47+
func testCenterY() {
48+
49+
}
50+
51+
func testSize() {
52+
53+
}
54+
55+
func testWidth() {
56+
57+
}
58+
59+
func testHeight() {
60+
61+
}
62+
63+
func testTop() {
64+
view.top = 10
65+
XCTAssertEqual(view.frame.origin, CGPoint(x: 0, y: 10), "top changes should just modify frame y")
66+
XCTAssertEqual(view.frame.size, CGSizeZero, "top changes should not modify frame size")
67+
}
68+
69+
func testRight() {
70+
71+
}
72+
73+
func testBottom() {
74+
75+
}
76+
77+
func testLeft() {
78+
79+
}
80+
81+
func testTop2() {
82+
83+
}
84+
85+
func testRight2() {
86+
87+
}
88+
89+
func testBottom2() {
90+
91+
}
92+
93+
func testLeft2() {
94+
95+
}
1596
}

ManualLayoutTests/ManualLayoutTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ internal class ManualLayoutTests: XCTestCase {
2121

2222
func testGetPositionForCenteringRect() {
2323
let positionX = ManualLayout.getPositionForCenteringRect(rect, dimension: .X, inRect: otherRect)
24-
XCTAssertEqual(positionX, CGFloat(55), "x position should be 55")
24+
XCTAssert(positionX == 55, "x position should be 55")
2525
let positionY = ManualLayout.getPositionForCenteringRect(rect, dimension: .Y, inRect: otherRect)
26-
XCTAssertEqual(positionY, CGFloat(65), "y position should be 65")
26+
XCTAssert(positionY == 65, "y position should be 65")
2727
}
2828
}

0 commit comments

Comments
 (0)