Navigation Menu

Skip to content

Commit

Permalink
Improve Adobe tests
Browse files Browse the repository at this point in the history
  • Loading branch information
inket committed Apr 19, 2023
1 parent c9d949c commit e100787
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions sttsTests/AdobeTests.swift
Expand Up @@ -7,9 +7,13 @@ import XCTest
@testable import stts

final class AdobeTests: XCTestCase {
func testNormalStatus() throws {
func testParsingStatus() throws {
let adobeCreativeCloud = AdobeCreativeCloudAll()
let adobePremierePro = AdobePremierePro()

let adobeExperienceCloud = AdobeExperienceCloudAll() // Should be .minor because Adobe Analytics is affected
let adobeAnalytics = AdobeAnalytics()

DataLoader.shared = DataLoader(session: ResponseOverridingURLSession(overrides: [
.init(
url: BaseAdobe.store.url,
Expand All @@ -26,28 +30,21 @@ final class AdobeTests: XCTestCase {
expectation.fulfill()
}

wait(for: [expectation], timeout: 3)
}

func testMinorStatus() throws {
let adobeAnalytics = AdobeAnalytics()

DataLoader.shared = DataLoader(session: ResponseOverridingURLSession(overrides: [
.init(
url: BaseAdobe.store.url,
response: try Data(
contentsOf: Bundle.test.url(forResource: "adobe-analytics-minor", withExtension: "json")!
)
)
]))

let expectation = XCTestExpectation(description: "Retrieve mocked status for Adobe")
adobeCreativeCloud.updateStatus { service in
XCTAssertEqual(service.status, .good)
expectation.fulfill()
}

adobeAnalytics.updateStatus { service in
XCTAssertEqual(service.status, .minor)
expectation.fulfill()
}

adobeExperienceCloud.updateStatus { service in
XCTAssertEqual(service.status, .minor)
expectation.fulfill()
}

wait(for: [expectation], timeout: 3)
}
}

0 comments on commit e100787

Please sign in to comment.