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

Update GroupReport model

parent 8df6ce7c
No related branches found
No related tags found
2 merge requests!102Release 1.0.0,!78Update Bindings
......@@ -4,15 +4,18 @@ public struct GroupReport: Equatable {
public init(
id: Data,
rounds: [Int],
roundURL: String,
status: Int
) {
self.id = id
self.rounds = rounds
self.roundURL = roundURL
self.status = status
}
public var id: Data
public var rounds: [Int]
public var roundURL: String
public var status: Int
}
......@@ -20,6 +23,7 @@ extension GroupReport: Codable {
enum CodingKeys: String, CodingKey {
case id = "Id"
case rounds = "Rounds"
case roundURL = "RoundURL"
case status = "Status"
}
......
......@@ -4,13 +4,15 @@ import XCTest
final class GroupReportTests: XCTestCase {
func testCoding() throws {
let idB64 = "EB/70R5HYEw5htZ4Hg9ondrn3+cAc/lH2G0mjQMja3w="
let rounds: [Int] = [1, 5, 9]
let status: Int = 123
let idB64 = "AAAAAAAAAM0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE"
let rounds: [Int] = [25, 64]
let roundURL = "https://dashboard.xx.network/rounds/25?xxmessenger=true"
let status: Int = 1
let jsonString = """
{
"Id": "\(idB64)",
"Rounds": [\(rounds.map { "\($0)" }.joined(separator: ", "))],
"RoundURL": "\(roundURL)",
"Status": \(status)
}
"""
......@@ -20,6 +22,7 @@ final class GroupReportTests: XCTestCase {
XCTAssertNoDifference(model, GroupReport(
id: Data(base64Encoded: idB64)!,
rounds: rounds,
roundURL: roundURL,
status: status
))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment