Skip to content

Commit

Permalink
Add protected to the settings model
Browse files Browse the repository at this point in the history
  • Loading branch information
SandroMachado committed Sep 7, 2017
1 parent 8a42cc7 commit e34d5ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Source/Model/Card/CardSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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?

Expand Down Expand Up @@ -38,6 +41,7 @@ public class CardSettings: Mappable {
*/
public func mapping(map: Map) {
position <- map["position"]
protected <- map["protected"]
starred <- map["starred"]
}

Expand Down
2 changes: 2 additions & 0 deletions Tests/Integration/Model/CardTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class CardTest: UpholdTestCase {
"\"lastTransactionAt\": \"foobiz\"," +
"\"settings\": {" +
"\"position\": 4," +
"\"protected\": true," +
"\"starred\": true" +
"}," +
"\"addresses\": [{" +
Expand Down Expand Up @@ -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.")
}

Expand Down

0 comments on commit e34d5ad

Please sign in to comment.