62 lines
1.5 KiB
Swift
62 lines
1.5 KiB
Swift
//
|
|
// Copyright Amazon.com Inc. or its affiliates.
|
|
// All Rights Reserved.
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
|
|
import AWSPinpoint
|
|
@testable import AWSPinpointAnalyticsPlugin
|
|
import Foundation
|
|
|
|
extension MockAWSPinpoint {
|
|
public func currentEndpointProfile() -> PinpointEndpointProfile {
|
|
currentEndpointProfileCalled += 1
|
|
|
|
return PinpointEndpointProfile(applicationId: applicationId, endpointId: endpointId)
|
|
}
|
|
|
|
public func updateEndpointProfile() async throws {
|
|
updateEndpointProfileCalled += 1
|
|
|
|
if case let .failure(error) = updateEndpointProfileResult {
|
|
throw error
|
|
}
|
|
}
|
|
|
|
public func update(_ endpointProfile: PinpointEndpointProfile) async throws {
|
|
updateEndpointProfileCalled += 1
|
|
updateEndpointProfileValue = endpointProfile
|
|
|
|
if case let .failure(error) = updateEndpointProfileResult {
|
|
throw error
|
|
}
|
|
}
|
|
|
|
public func addAttributes(_ attributes: [String], forKey key: String) {
|
|
addAttributeCalled += 1
|
|
|
|
addAttributeValue = attributes
|
|
addAttributeKey = key
|
|
}
|
|
|
|
public func removeAttributes(forKey key: String) {
|
|
removeAttributeCalled += 1
|
|
|
|
removeAttributeKey = key
|
|
}
|
|
|
|
public func addMetric(_ metric: Double, forKey key: String) {
|
|
addMetricCalled += 1
|
|
|
|
addMetricValue = metric
|
|
addMetricKey = key
|
|
}
|
|
|
|
public func removeMetric(forKey theKey: String) {
|
|
removeMetricCalled += 1
|
|
|
|
removeMetricKey = theKey
|
|
}
|
|
}
|