Skip to content

Commit

Permalink
iPhone 11 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentneo committed Sep 21, 2019
1 parent 3579ead commit 2d558e5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Tests/DeviceModelTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
12 changes: 12 additions & 0 deletions Tests/IdentifierTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down

0 comments on commit 2d558e5

Please sign in to comment.