diff --git a/Tests/DeviceFamilyTests.swift b/Tests/DeviceFamilyTests.swift index c8139ab..8a83d79 100644 --- a/Tests/DeviceFamilyTests.swift +++ b/Tests/DeviceFamilyTests.swift @@ -41,6 +41,11 @@ class DeviceFamilyTests: XCTestCase { XCTAssert(deviceFamily == .iPad, "DeviceFamily - .iPad is failing") } + func testInvalidDeviceFamily() { + let deviceFamily = DeviceFamily(rawValue: "Apple II") + XCTAssert(deviceFamily == .unknown, "DeviceFamily - .unknown is failing") + } + func testDeviceIsSimulator() { let deviceFamily = DeviceFamily(rawValue: "iPhone") #if arch(i386) || arch(x86_64) diff --git a/Tests/DeviceModelTests.swift b/Tests/DeviceModelTests.swift index 21aae2d..0abe55d 100644 --- a/Tests/DeviceModelTests.swift +++ b/Tests/DeviceModelTests.swift @@ -325,6 +325,13 @@ class DeviceModelTests: XCTestCase { XCTAssert(deviceModel == .iPodTouchSeventhGen , "DeviceModel - .iPodSeventhGen is failing") } + // MARK: Unknown Device Test + + func testInvalidDeviceModel() { + let deviceModel = DeviceModel(identifier: Identifier("iPhone0,1")) + XCTAssert(deviceModel == .unknown, "DeviceModel - .unknown is failing") + } + // MARK: Notch test func testHasNotch() { let notchModels: [DeviceModel] = [.iPhoneX, .iPhoneXS, .iPhoneXSMax, .iPhoneXR, .iPhone11, .iPhone11Pro, .iPhone11ProMax]