Skip to content

Commit c11f90e

Browse files
committed
Update iPhone Tests
1 parent 8cb128d commit c11f90e

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

Tests/DeviceModelTests.swift

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,26 @@ class DeviceModelTests: XCTestCase {
242242
XCTAssert(deviceModel == .iPhone15ProMax , "DeviceModel - .iPhone15ProMax is failing")
243243
}
244244

245+
func testDeviceModelIPhone16() {
246+
let deviceModel = DeviceModel(identifier: Identifier("iPhone17,3"))
247+
XCTAssert(deviceModel == .iPhone16, "DeviceModel - .iPhone16 is failing")
248+
}
249+
250+
func testDeviceModelIPhone16Plus() {
251+
let deviceModel = DeviceModel(identifier: Identifier("iPhone17,4"))
252+
XCTAssert(deviceModel == .iPhone16Plus, "DeviceModel - .iPhone16Plus is failing")
253+
}
254+
255+
func testDeviceModelIPhone16Pro() {
256+
let deviceModel = DeviceModel(identifier: Identifier("iPhone17,1"))
257+
XCTAssert(deviceModel == .iPhone16Pro, "DeviceModel - .iPhone16Pro is failing")
258+
}
259+
260+
func testDeviceModelIPhone16ProMax() {
261+
let deviceModel = DeviceModel(identifier: Identifier("iPhone17,2"))
262+
XCTAssert(deviceModel == .iPhone16ProMax, "DeviceModel - .iPhone16ProMax is failing")
263+
}
264+
245265
// MARK: - iPad Device Model tests
246266

247267
func testDeviceModelIPadFirstGen() {
@@ -523,7 +543,8 @@ class DeviceModelTests: XCTestCase {
523543

524544
func testHasDynamicIsland() {
525545
let withModels: [DeviceModel] = [.iPhone14Pro, .iPhone14ProMax,
526-
.iPhone15, .iPhone15Plus, .iPhone15Pro, .iPhone15ProMax]
546+
.iPhone15, .iPhone15Plus, .iPhone15Pro, .iPhone15ProMax,
547+
.iPhone16, .iPhone16Plus, .iPhone16Pro, .iPhone16ProMax]
527548

528549
let withoutModels: [DeviceModel] = DeviceModel.allCases.filter( { !withModels.contains($0) })
529550

Tests/IdentifierTests.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,22 @@ class IdentifierTests: XCTestCase {
6666
#if os(iOS)
6767
// MARK: - iPhone String Description tests
6868

69+
func testDisplayStringiPhone17v4() {
70+
XCTAssert(Identifier("iPhone17,4").description == "iPhone 16 Plus", "iPhone17,4 is failing to produce a common device model string")
71+
}
72+
73+
func testDisplayStringiPhone17v3() {
74+
XCTAssert(Identifier("iPhone17,3").description == "iPhone 16", "iPhone17,3 is failing to produce a common device model string")
75+
}
76+
77+
func testDisplayStringiPhone17v2() {
78+
XCTAssert(Identifier("iPhone17,2").description == "iPhone 16 Pro Max", "iPhone17,2 is failing to produce a common device model string")
79+
}
80+
81+
func testDisplayStringiPhone17v1() {
82+
XCTAssert(Identifier("iPhone17,1").description == "iPhone 16 Pro", "iPhone17,1 is failing to produce a common device model string")
83+
}
84+
6985
func testDisplayStringiPhone16v2() {
7086
XCTAssert(Identifier("iPhone16,2").description == "iPhone 15 Pro Max", "iPhone16,2 is failing to produce a common device model string")
7187
}

0 commit comments

Comments
 (0)