Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kober32 committed Nov 18, 2024
1 parent becf3eb commit 476a5fb
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions WultraMobileTokenSDKTests/ProvisioningUtilsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,25 @@ class ProvisioningUtilsTests: XCTestCase {
func testParseDevelopmentAPNS() {
let plist = getProfile("development")
let profile = WMTProvisioningUtils.parseProvisioningProfile(plist)
let env = WMTProvisioningUtils.getApnsEnvironment(profile: profile)
XCTAssertEqual(env, .development)
XCTAssertEqual(profile?.apnsEnvironment, .development)
}

func testParseProductionAPNS() {
let plist = getProfile("production")
let profile = WMTProvisioningUtils.parseProvisioningProfile(plist)
let env = WMTProvisioningUtils.getApnsEnvironment(profile: profile)
XCTAssertEqual(env, .production)
XCTAssertEqual(profile?.apnsEnvironment, .production)
}

func testParseMissingAPNS() {
let plist = getProfile(nil)
let profile = WMTProvisioningUtils.parseProvisioningProfile(plist)
let env = WMTProvisioningUtils.getApnsEnvironment(profile: profile)
XCTAssertEqual(env, nil)
XCTAssertEqual(profile?.apnsEnvironment, nil)
}

func testParseUnknownAPNS() {
let plist = getProfile("integration") // unknown value
let profile = WMTProvisioningUtils.parseProvisioningProfile(plist)
let env = WMTProvisioningUtils.getApnsEnvironment(profile: profile)
XCTAssertEqual(env, nil)
XCTAssertEqual(profile?.apnsEnvironment, nil)
}

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

0 comments on commit 476a5fb

Please sign in to comment.