diff --git a/.swiftpm/xcode/xcshareddata/xcschemes/Confidence-Package.xcscheme b/.swiftpm/xcode/xcshareddata/xcschemes/Confidence-Package.xcscheme new file mode 100644 index 00000000..4f466f8b --- /dev/null +++ b/.swiftpm/xcode/xcshareddata/xcschemes/Confidence-Package.xcscheme @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.swiftpm/xcode/xcshareddata/xcschemes/Confidence.xcscheme b/.swiftpm/xcode/xcshareddata/xcschemes/Confidence.xcscheme new file mode 100644 index 00000000..0e8ddb01 --- /dev/null +++ b/.swiftpm/xcode/xcshareddata/xcschemes/Confidence.xcscheme @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sources/Confidence/Confidence.swift b/Sources/Confidence/Confidence.swift index 96147b19..e0006979 100644 --- a/Sources/Confidence/Confidence.swift +++ b/Sources/Confidence/Confidence.swift @@ -60,9 +60,6 @@ public class Confidence: ConfidenceEventSender { context: context, parent: self) } - public func clearContext() { - context = [:] - } } extension Confidence { diff --git a/Sources/Confidence/EventSenderStorage.swift b/Sources/Confidence/EventSenderStorage.swift index 909ae8bb..d25333bf 100644 --- a/Sources/Confidence/EventSenderStorage.swift +++ b/Sources/Confidence/EventSenderStorage.swift @@ -1,6 +1,6 @@ import Foundation -struct EventBatchRequest: Codable { +struct EventBatchRequest: Encodable { let clientSecret: String let sendTime: Date let events: [Event] diff --git a/Tests/ConfidenceProviderTests/EventSenderEngineTest.swift b/Tests/ConfidenceProviderTests/EventSenderEngineTest.swift index fee5898d..9c4adc6b 100644 --- a/Tests/ConfidenceProviderTests/EventSenderEngineTest.swift +++ b/Tests/ConfidenceProviderTests/EventSenderEngineTest.swift @@ -35,8 +35,8 @@ final class EventSenderEngineTest: XCTestCase { var events: [Event] = [] for i in 0..<5 { - events.append(Event(name: "\(i)")) - eventSenderEngine.send(name: "\(i)") + events.append(Event(name: "\(i)", payload: [:])) + eventSenderEngine.send(name: "\(i)", message: [:]) } let expectedRequest = EventBatchRequest(clientSecret: "CLIENT_SECRET", sendTime: Date(), events: events) @@ -45,7 +45,7 @@ final class EventSenderEngineTest: XCTestCase { XCTAssertTrue(uploadRequest.events == expectedRequest.events) uploader.reset() - eventSenderEngine.send(name: "Hello") + eventSenderEngine.send(name: "Hello", message: [:]) XCTAssertNil(uploader.calledRequest) } }