Skip to content

Commit

Permalink
Merge pull request #3 from Hans92/main
Browse files Browse the repository at this point in the history
Update Unit Tests
  • Loading branch information
Toni77777 authored Sep 28, 2022
2 parents 2a57703 + f451753 commit b520d1b
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 17 deletions.
12 changes: 12 additions & 0 deletions Tests/PreviewDeviceTests/DeviceAppleTVTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,16 @@ final class DeviceAppleTVTests: XCTestCase {
let iphone: Device = .appleTV4K1080p
XCTAssertEqual(iphone.rawValue, "Apple TV 4K (at 1080p)")
}

// MARK: - Apple TV 4K 2 Gen

func testAppleTV4KGen2HasCorrectName() {
let iphone: Device = .appleTV4K_2Gen
XCTAssertEqual(iphone.rawValue, "Apple TV 4K (2nd generation)")
}

func testAppleTV4KGen21080pHasCorretName() {
let iphone: Device = .appleTV4K1080p_2Gen
XCTAssertEqual(iphone.rawValue, "Apple TV 4K (at 1080p) (2nd generation)")
}
}
15 changes: 15 additions & 0 deletions Tests/PreviewDeviceTests/DeviceIpadTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ final class DeviceIpadTests: XCTestCase {
XCTAssertEqual(iphone.rawValue, "iPad Air (4th generation)")
}

func testIpadAir_5GenHasCorretName() {
let ipad: Device = .ipadAir_5Gen
XCTAssertEqual(ipad.rawValue, "iPad Air (5th generation)")
}

// MARK: - Ipad mini 2, mini 3, mini 4, mini 5

func testIpadMini2HasCorretName() {
Expand Down Expand Up @@ -132,8 +137,18 @@ final class DeviceIpadTests: XCTestCase {
XCTAssertEqual(iphone.rawValue, "iPad Pro (11-inch) (2nd generation)")
}

func testIpadPro11inch_3GenHasCorretName() {
let iphone: Device = .ipadPro11inch_3Gen
XCTAssertEqual(iphone.rawValue, "iPad Pro (11-inch) (3rd generation)")
}

func testIpadPro12_9inch_4GenHasCorretName() {
let iphone: Device = .ipadPro12_9inch_4Gen
XCTAssertEqual(iphone.rawValue, "iPad Pro (12.9-inch) (4th generation)")
}

func testIpadPro12_9inch_5GenHasCorretName() {
let ipad: Device = .ipadPro12_9inch_5Gen
XCTAssertEqual(ipad.rawValue, "iPad Pro (12.9-inch) (5th generation)")
}
}
29 changes: 28 additions & 1 deletion Tests/PreviewDeviceTests/DeviceIphoneTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ final class DeviceIphoneTests: XCTestCase {
XCTAssertEqual(iphone.rawValue, "iPhone 8 Plus")
}

// MARK: - Iphone SE 1 Gen, SE 2 Gen
// MARK: - Iphone SE 1 Gen, SE 2 Gen, SE 3 Gen

func testIphoneSE1GenHasCorretName() {
let iphone: Device = .iphoneSE_1Gen
Expand All @@ -69,6 +69,11 @@ final class DeviceIphoneTests: XCTestCase {
XCTAssertEqual(iphone.rawValue, "iPhone SE (2nd generation)")
}

func testIphoneSE3GenHasCorrectName() {
let iphone: Device = .iphoneSE_3Gen
XCTAssertEqual(iphone.rawValue, "iPhone SE (3rd generation)")
}

// MARK: - Iphone X, Xs, XsMax, Xr

func testIphoneXHasCorretName() {
Expand Down Expand Up @@ -151,4 +156,26 @@ final class DeviceIphoneTests: XCTestCase {
let iphone: Device = .iphone13ProMax
XCTAssertEqual(iphone.rawValue, "iPhone 13 Pro Max")
}

// MARK: - Iphone 14, 14 Plus, 14 Pro, 14 Pro Max

func testIphone14HasCorrectName() {
let iphone: Device = .iphone14
XCTAssertEqual(iphone.rawValue, "iPhone 14")
}

func testIphone14PlusHasCorrectName() {
let iphone: Device = .iphone14Plus
XCTAssertEqual(iphone.rawValue, "iPhone 14 Plus")
}

func testIphone14ProHasCorrectName() {
let iphone: Device = .iphone14Pro
XCTAssertEqual(iphone.rawValue, "iPhone 14 Pro")
}

func testIphone14ProMaxHasCorrectName() {
let iphone: Device = .iphone14ProMax
XCTAssertEqual(iphone.rawValue, "iPhone 14 Pro Max")
}
}
63 changes: 47 additions & 16 deletions Tests/PreviewDeviceTests/DeviceWatchTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,95 +13,126 @@ final class DeviceWatchTests: XCTestCase {

func testWatch_38mmHasCorretName() {
let iphone: Device = .watch_38mm
XCTAssertEqual(iphone.rawValue, "Apple Watch - 38mm")
XCTAssertEqual(iphone.rawValue, "Apple Watch (38mm)")
}

func testWatch_42mmHasCorretName() {
let iphone: Device = .watch_42mm
XCTAssertEqual(iphone.rawValue, "Apple Watch - 42mm")
XCTAssertEqual(iphone.rawValue, "Apple Watch (42mm)")
}

// MARK: - Watch Series 2 32mm, 42mm

func testWatchSeries2_38mmHasCorretName() {
let iphone: Device = .watchSeries2_38mm
XCTAssertEqual(iphone.rawValue, "Apple Watch Series 2 - 38mm")
XCTAssertEqual(iphone.rawValue, "Apple Watch Series 2 (38mm)")
}

func testWatchSeries2_42mmHasCorretName() {
let iphone: Device = .watchSeries2_42mm
XCTAssertEqual(iphone.rawValue, "Apple Watch Series 2 - 42mm")
XCTAssertEqual(iphone.rawValue, "Apple Watch Series 2 (42mm)")
}

// MARK: - Watch Series 3 32mm, 42mm

func testWatchSeries3_38mmHasCorretName() {
let iphone: Device = .watchSeries3_38mm
XCTAssertEqual(iphone.rawValue, "Apple Watch Series 3 - 38mm")
XCTAssertEqual(iphone.rawValue, "Apple Watch Series 3 (38mm)")
}

func testWatchSeries3_42mmHasCorretName() {
let iphone: Device = .watchSeries3_42mm
XCTAssertEqual(iphone.rawValue, "Apple Watch Series 3 - 42mm")
XCTAssertEqual(iphone.rawValue, "Apple Watch Series 3 (42mm)")
}

// MARK: - Watch Series 4 40mm, 44mm

func testWatchSeries4_40mmHasCorretName() {
let iphone: Device = .watchSeries4_40mm
XCTAssertEqual(iphone.rawValue, "Apple Watch Series 4 - 40mm")
XCTAssertEqual(iphone.rawValue, "Apple Watch Series 4 (40mm)")
}

func testWatchSeries4_44mmHasCorretName() {
let iphone: Device = .watchSeries4_44mm
XCTAssertEqual(iphone.rawValue, "Apple Watch Series 4 - 44mm")
XCTAssertEqual(iphone.rawValue, "Apple Watch Series 4 (44mm)")
}

// MARK: - Watch Series 5 40mm, 44mm

func testWatchSeries5_40mmHasCorretName() {
let iphone: Device = .watchSeries5_40mm
XCTAssertEqual(iphone.rawValue, "Apple Watch Series 5 - 40mm")
XCTAssertEqual(iphone.rawValue, "Apple Watch Series 5 (40mm)")
}

func testWatchSeries5_44mmHasCorretName() {
let iphone: Device = .watchSeries5_44mm
XCTAssertEqual(iphone.rawValue, "Apple Watch Series 5 - 44mm")
XCTAssertEqual(iphone.rawValue, "Apple Watch Series 5 (44mm)")
}

// MARK: - Watch Series 6 40mm, 44mm

func testWatchSeries6_40mmHasCorretName() {
let iphone: Device = .watchSeries6_40mm
XCTAssertEqual(iphone.rawValue, "Apple Watch Series 6 - 40mm")
XCTAssertEqual(iphone.rawValue, "Apple Watch Series 6 (40mm)")
}

func testWatchSeries6_44mmHasCorretName() {
let iphone: Device = .watchSeries6_44mm
XCTAssertEqual(iphone.rawValue, "Apple Watch Series 6 - 44mm")
XCTAssertEqual(iphone.rawValue, "Apple Watch Series 6 (44mm)")
}

// MARK: - Watch Series 7 41mm, 45mm

func testWatchSeries7_41mmHasCorretName() {
let iphone: Device = .watchSeries7_41mm
XCTAssertEqual(iphone.rawValue, "Apple Watch Series 7 - 41mm")
XCTAssertEqual(iphone.rawValue, "Apple Watch Series 7 (41mm)")
}

func testWatchSeries7_45mmHasCorretName() {
let iphone: Device = .watchSeries7_45mm
XCTAssertEqual(iphone.rawValue, "Apple Watch Series 7 - 45mm")
XCTAssertEqual(iphone.rawValue, "Apple Watch Series 7 (45mm)")
}

// MARK: - Watch Series 8 41mm, 45mm

func testWatchSeries8_41mmHasCorrectName() {
let watch: Device = .watchSeries8_41mm
XCTAssertEqual(watch.rawValue, "Apple Watch Series 8 (41mm)")
}

func testWatchSeries8_45mmHasCorrectName() {
let watch: Device = .watchSeries8_45mm
XCTAssertEqual(watch.rawValue, "Apple Watch Series 8 (45mm)")
}

// MARK: - Watch SE 40mm, 44mm

func testWatchSE_40mmHasCorretName() {
let iphone: Device = .watchSE_40mm
XCTAssertEqual(iphone.rawValue, "Apple Watch SE - 40mm")
XCTAssertEqual(iphone.rawValue, "Apple Watch SE (40mm)")
}

func testWatchSE_44mmmmHasCorretName() {
let iphone: Device = .watchSE_44mm
XCTAssertEqual(iphone.rawValue, "Apple Watch SE - 44mm")
XCTAssertEqual(iphone.rawValue, "Apple Watch SE (44mm)")
}

// MARK: - Watch SE 2 Gen 40mm, 44mm

func testWatchSE_2Gen_40mmHasCorrectName() {
let watch: Device = .watchSE_2Gen_40mm
XCTAssertEqual(watch.rawValue, "Apple Watch SE (40mm) (2nd generation)")
}

func testWatchSE_2Gen_44mmHasCorrectName() {
let watch: Device = .watchSE_2Gen_44mm
XCTAssertEqual(watch.rawValue, "Apple Watch SE (44mm) (2nd generation)")
}

// MARK: - Watch Ultra 49mm

func testWatchUltra_49mmHasCorrectName() {
let watch: Device = .watchUltra_49mm
XCTAssertEqual(watch.rawValue, "Apple Watch Ultra (49mm)")
}
}

0 comments on commit b520d1b

Please sign in to comment.