Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kober32 committed Nov 26, 2024
1 parent 81eb2f0 commit bd325a6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions WultraMobileTokenSDKTests/ProvisioningUtilsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,33 +27,33 @@ class ProvisioningUtilsTests: XCTestCase {
return
}
let profile = WMTProvisioningUtils.getProvisioningProfileFromData(data)
XCTAssertEqual(profile?.apnsEnvironment, .production)
XCTAssertEqual(profile?.entitlements.apsEnvironment, .production)
}

// plist parsing

func testParseDevelopmentAPNS() {
let plist = getPlist("development")
let profile = WMTProvisioningUtils.parseProvisioningProfilePlist(plist)
XCTAssertEqual(profile?.apnsEnvironment, .development)
XCTAssertEqual(profile?.entitlements.apsEnvironment, .development)
}

func testParseProductionAPNS() {
let plist = getPlist("production")
let profile = WMTProvisioningUtils.parseProvisioningProfilePlist(plist)
XCTAssertEqual(profile?.apnsEnvironment, .production)
XCTAssertEqual(profile?.entitlements.apsEnvironment, .production)
}

func testParseMissingAPNS() {
let plist = getPlist(nil)
let profile = WMTProvisioningUtils.parseProvisioningProfilePlist(plist)
XCTAssertEqual(profile?.apnsEnvironment, nil)
XCTAssertEqual(profile?.entitlements.apsEnvironment, nil)
}

func testParseUnknownAPNS() {
let plist = getPlist("integration") // unknown value
let profile = WMTProvisioningUtils.parseProvisioningProfilePlist(plist)
XCTAssertEqual(profile?.apnsEnvironment, nil)
XCTAssertEqual(profile?.entitlements.apsEnvironment, nil)
}

private func getPlist(_ apnsEnvironment: String?) -> Data {
Expand Down

0 comments on commit bd325a6

Please sign in to comment.