diff --git a/Sources/XXMessengerClient/Messenger/Functions/MessengerGetNotificationReport.swift b/Sources/XXMessengerClient/Messenger/Functions/MessengerGetNotificationReport.swift index a7f04ff91554e2982cfb082cb49a9c289985dd6f..0b7de4fa53d46fa7fcbee1b5db3c17f1720a2022 100644 --- a/Sources/XXMessengerClient/Messenger/Functions/MessengerGetNotificationReport.swift +++ b/Sources/XXMessengerClient/Messenger/Functions/MessengerGetNotificationReport.swift @@ -6,9 +6,9 @@ public struct MessengerGetNotificationReport { case serviceListMissing } - public var run: (String) throws -> NotificationReport + public var run: (String) throws -> [NotificationReport] - public func callAsFunction(notificationCSV: String) throws -> NotificationReport { + public func callAsFunction(notificationCSV: String) throws -> [NotificationReport] { try run(notificationCSV) } } diff --git a/Tests/XXMessengerClientTests/Messenger/Functions/MessengerGetNotificationReportTests.swift b/Tests/XXMessengerClientTests/Messenger/Functions/MessengerGetNotificationReportTests.swift index eed49be16789ec70d6179e9b5c0a8c5fc2e2e171..7d778c0dc07bb8849513e2e1ae6c5fe18ffbc98b 100644 --- a/Tests/XXMessengerClientTests/Messenger/Functions/MessengerGetNotificationReportTests.swift +++ b/Tests/XXMessengerClientTests/Messenger/Functions/MessengerGetNotificationReportTests.swift @@ -8,7 +8,7 @@ final class MessengerGetNotificationReportTests: XCTestCase { func testGetReport() throws { let serviceList = MessageServiceList.stub() let notificationCSV = "notification-csv" - let notificationReport = NotificationReport.stub() + let notificationReports = [NotificationReport].stub() struct GetNotificationsReportParams: Equatable { var notificationCSV: String @@ -25,11 +25,11 @@ final class MessengerGetNotificationReportTests: XCTestCase { notificationCSV: notificationCSV, serviceList: serviceList )) - return notificationReport + return notificationReports } let getReport: MessengerGetNotificationReport = .live(env) - let report = try getReport(notificationCSV: notificationCSV) + let reports = try getReport(notificationCSV: notificationCSV) XCTAssertNoDifference(didGetNotificationsReport, [ .init( @@ -37,7 +37,7 @@ final class MessengerGetNotificationReportTests: XCTestCase { serviceList: serviceList ) ]) - XCTAssertNoDifference(report, notificationReport) + XCTAssertNoDifference(reports, notificationReports) } func testGetReportWhenServiceListMissing() { @@ -55,7 +55,13 @@ final class MessengerGetNotificationReportTests: XCTestCase { } } -extension NotificationReport { +private extension Array where Element == NotificationReport { + static func stub() -> [NotificationReport] { + [.stub(), .stub(), .stub()] + } +} + +private extension NotificationReport { static func stub() -> NotificationReport { NotificationReport( forMe: .random(),