|
|
@@ -395,7 +395,7 @@ class SnapKitTests: XCTestCase {
|
|
|
let constraints = view.snp_constraints as! [NSLayoutConstraint]
|
|
|
|
|
|
// no guarantee which order the constraints are in, but we should test their couple
|
|
|
- let widthHeight = (NSLayoutAttribute.width.rawValue, NSLayoutAttribute.height.rawValue)
|
|
|
+ let widthHeight = (LayoutAttribute.width.rawValue, LayoutAttribute.height.rawValue)
|
|
|
let heightWidth = (widthHeight.1, widthHeight.0)
|
|
|
let firstSecond = (constraints[0].firstAttribute.rawValue, constraints[1].firstAttribute.rawValue)
|
|
|
|
|
|
@@ -416,10 +416,11 @@ class SnapKitTests: XCTestCase {
|
|
|
XCTAssertEqual(self.container.snp_constraints.count, 2, "Should have 2 constraints")
|
|
|
|
|
|
|
|
|
- let constraints = self.container.snp_constraints as! [NSLayoutConstraint]
|
|
|
+ if let constraints = self.container.snp_constraints as? [NSLayoutConstraint], constraints.count > 0 {
|
|
|
|
|
|
- XCTAssertEqual(constraints[0].constant, 50, "Should be 50")
|
|
|
- XCTAssertEqual(constraints[1].constant, 50, "Should be 50")
|
|
|
+ XCTAssertEqual(constraints[0].constant, 50, "Should be 50")
|
|
|
+ XCTAssertEqual(constraints[1].constant, 50, "Should be 50")
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
func testConstraintIdentifier() {
|
|
|
@@ -436,8 +437,8 @@ class SnapKitTests: XCTestCase {
|
|
|
}
|
|
|
|
|
|
func testEdgesToEdges() {
|
|
|
- var fromAttributes = Set<NSLayoutAttribute>()
|
|
|
- var toAttributes = Set<NSLayoutAttribute>()
|
|
|
+ var fromAttributes = Set<LayoutAttribute>()
|
|
|
+ var toAttributes = Set<LayoutAttribute>()
|
|
|
|
|
|
let view = View()
|
|
|
self.container.addSubview(view)
|