Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
danramteke committed Jun 13, 2019
1 parent 4dde97e commit 692b412
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
4 changes: 0 additions & 4 deletions Sources/UIDeviceExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ public extension UIDeviceComplete where Base == UIDevice {
var isSimulator: Bool {
return deviceFamily == .simulator
}

var hasNotch: Bool {
return deviceModel.hasNotch
}
}


Expand Down
11 changes: 10 additions & 1 deletion Tests/DeviceModelTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -311,5 +311,14 @@ class DeviceModelTests: XCTestCase {

XCTAssert(deviceModel == .unknown , "DeviceModel - .unknown is failing")
}


// MARK: Notch test
func testHasNotch() {
let notchModels: [DeviceModel] = [.iPhoneX, .iPhoneXS, .iPhoneXSMax, .iPhoneXR]

let noNotchModels: [DeviceModel] = DeviceModel.allCases.filter( { !notchModels.contains($0) })

notchModels.forEach { XCTAssertTrue($0.hasNotch) }
noNotchModels.forEach { XCTAssertFalse($0.hasNotch) }
}
}
10 changes: 0 additions & 10 deletions Tests/UIDeviceExtensionsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,4 @@ class UIDeviceExtensionsTests: XCTestCase {
let deviceFamily = DeviceFamily(rawValue: "x86_64")
XCTAssert(deviceFamily == .simulator, "DeviceExtensions - .isSimulator is failing")
}


func testHasNotch() {
let notchModels: [DeviceModel] = [.iPhoneX, .iPhoneXS, .iPhoneXSMax, .iPhoneXR]

let noNotchModels: [DeviceModel] = DeviceModel.allCases.filter( { !notchModels.contains($0) })

notchModels.forEach { XCTAssertTrue($0.hasNotch) }
noNotchModels.forEach { XCTAssertFalse($0.hasNotch) }
}
}

0 comments on commit 692b412

Please sign in to comment.