Skip to content

Commit

Permalink
improve test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentneo committed Oct 4, 2019
1 parent 8158559 commit 59a509d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Tests/DeviceFamilyTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions Tests/DeviceModelTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 59a509d

Please sign in to comment.