Skip to content
Snippets Groups Projects
Commit 065dbc91 authored by Dariusz Rybicki's avatar Dariusz Rybicki
Browse files

Update MessengerGetNotificationReport

parent 86e5199c
No related branches found
No related tags found
2 merge requests!142Fix GetNotificationsReport,!102Release 1.0.0
......@@ -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)
}
}
......
......@@ -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(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment