From 2d558e5475dbacfb1e6d6fffdb3a76e07d311174 Mon Sep 17 00:00:00 2001 From: Vincent Neo <23420208+vincentneo@users.noreply.github.com> Date: Sat, 21 Sep 2019 22:03:32 +0800 Subject: [PATCH] iPhone 11 tests --- Tests/DeviceModelTests.swift | 15 +++++++++++++++ Tests/IdentifierTests.swift | 12 ++++++++++++ 2 files changed, 27 insertions(+) diff --git a/Tests/DeviceModelTests.swift b/Tests/DeviceModelTests.swift index 0276e71..a197159 100644 --- a/Tests/DeviceModelTests.swift +++ b/Tests/DeviceModelTests.swift @@ -136,6 +136,21 @@ class DeviceModelTests: XCTestCase { XCTAssert(deviceModel == .iPhoneXR , "DeviceModel - .iPhoneXR is failing") } + func testDeviceModelIPhone11Pro() { + let deviceModel = DeviceModel(identifier: Identifier("iPhone12,3")) + XCTAssert(deviceModel == .iPhone11Pro , "DeviceModel - .iPhone11Pro is failing") + } + + func testDeviceModelIPhone11ProMax() { + let deviceModel = DeviceModel(identifier: Identifier("iPhone12,5")) + XCTAssert(deviceModel == .iPhone11ProMax , "DeviceModel - .iPhone11ProMax is failing") + } + + func testDeviceModelIPhone11() { + let deviceModel = DeviceModel(identifier: Identifier("iPhone12,1")) + XCTAssert(deviceModel == .iPhone11 , "DeviceModel - .iPhone11 is failing") + } + // MARK: - iPad Device Model tests func testDeviceModelIPadFirstGen() { diff --git a/Tests/IdentifierTests.swift b/Tests/IdentifierTests.swift index 610a55c..63c9a0e 100644 --- a/Tests/IdentifierTests.swift +++ b/Tests/IdentifierTests.swift @@ -90,6 +90,18 @@ class IdentifierTests: XCTestCase { // MARK: - iPhone String Description tests + func testDisplayStringiPhone12v5() { + XCTAssert(Identifier("iPhone12,5").description == "iPhone 11 Pro Max", "iPhone12,5 is failing to produce a common device model string") + } + + func testDisplayStringiPhone12v3() { + XCTAssert(Identifier("iPhone12,3").description == "iPhone 11 Pro", "iPhone12,3 is failing to produce a common device model string") + } + + func testDisplayStringiPhone12v1() { + XCTAssert(Identifier("iPhone12,1").description == "iPhone 11", "iPhone12,1 is failing to produce a common device model string") + } + func testDisplayStringiPhone11v8() { XCTAssert(Identifier("iPhone11,8").description == "iPhone XR", "iPhone11,8 is failing to produce a common device model string") }