From e34d5adaac473b56ff9f93838961255a05cb770f Mon Sep 17 00:00:00 2001 From: Sandro Machado Date: Thu, 7 Sep 2017 10:52:03 +0100 Subject: [PATCH] Add protected to the settings model --- Source/Model/Card/CardSettings.swift | 4 ++++ Tests/Integration/Model/CardTest.swift | 2 ++ 2 files changed, 6 insertions(+) diff --git a/Source/Model/Card/CardSettings.swift b/Source/Model/Card/CardSettings.swift index e888bab..442c534 100644 --- a/Source/Model/Card/CardSettings.swift +++ b/Source/Model/Card/CardSettings.swift @@ -7,6 +7,9 @@ public class CardSettings: Mappable { /// The position of the card. public private(set) final var position: Int? + /// A boolean indicating if the card is protected. + public private(set) final var protected: Bool? + /// A boolean indicating if the card is starred. public private(set) final var starred: Bool? @@ -38,6 +41,7 @@ public class CardSettings: Mappable { */ public func mapping(map: Map) { position <- map["position"] + protected <- map["protected"] starred <- map["starred"] } diff --git a/Tests/Integration/Model/CardTest.swift b/Tests/Integration/Model/CardTest.swift index c565be1..3555105 100644 --- a/Tests/Integration/Model/CardTest.swift +++ b/Tests/Integration/Model/CardTest.swift @@ -19,6 +19,7 @@ class CardTest: UpholdTestCase { "\"lastTransactionAt\": \"foobiz\"," + "\"settings\": {" + "\"position\": 4," + + "\"protected\": true," + "\"starred\": true" + "}," + "\"addresses\": [{" + @@ -47,6 +48,7 @@ class CardTest: UpholdTestCase { XCTAssertEqual(card!.normalized![0].balance!, "99.04", "Failed: Balance didn't match.") XCTAssertEqual(card!.normalized![0].currency!, "USD", "Failed: Currency didn't match.") XCTAssertEqual(card!.settings!.position!, 4, "Failed: Position didn't match.") + XCTAssertTrue(card!.settings!.protected!, "Failed: Protected didn't match.") XCTAssertTrue(card!.settings!.starred!, "Failed: Starred didn't match.") }