From 692b4124ff9f7df5c2821f8fc8572ce0819610fc Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 13 Jun 2019 18:57:02 -0400 Subject: [PATCH] clean up --- Sources/UIDeviceExtensions.swift | 4 ---- Tests/DeviceModelTests.swift | 11 ++++++++++- Tests/UIDeviceExtensionsTests.swift | 10 ---------- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/Sources/UIDeviceExtensions.swift b/Sources/UIDeviceExtensions.swift index 048156c..9c5a1e5 100644 --- a/Sources/UIDeviceExtensions.swift +++ b/Sources/UIDeviceExtensions.swift @@ -65,10 +65,6 @@ public extension UIDeviceComplete where Base == UIDevice { var isSimulator: Bool { return deviceFamily == .simulator } - - var hasNotch: Bool { - return deviceModel.hasNotch - } } diff --git a/Tests/DeviceModelTests.swift b/Tests/DeviceModelTests.swift index 228ec74..0276e71 100644 --- a/Tests/DeviceModelTests.swift +++ b/Tests/DeviceModelTests.swift @@ -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) } + } } diff --git a/Tests/UIDeviceExtensionsTests.swift b/Tests/UIDeviceExtensionsTests.swift index 76a07e1..0c87d98 100644 --- a/Tests/UIDeviceExtensionsTests.swift +++ b/Tests/UIDeviceExtensionsTests.swift @@ -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) } - } }