Skip to content

Commit

Permalink
Update test variables unwrap
Browse files Browse the repository at this point in the history
  • Loading branch information
diogoguimaraes committed Dec 11, 2015
1 parent b528499 commit be69a4e
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 61 deletions.
66 changes: 33 additions & 33 deletions Tests/Integration/Model/CardTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -115,20 +115,20 @@ class CardTest: UpholdTestCase {

card.createTransaction(transactionRequest).then { (transaction: Transaction) -> () in
XCTAssertEqual(transaction.createdAt, "2014-08-27T00:01:11.616Z", "Failed: Wrong transaction createdAt.")
XCTAssertEqual(transaction.denomination?.amount, "0.1", "Failed: Wrong transaction denomination amount.")
XCTAssertEqual(transaction.denomination?.currency, "BTC", "Failed: Wrong transaction denomination currency.")
XCTAssertEqual(transaction.denomination?.pair, "BTCBTC", "Failed: Wrong transaction denomination pair.")
XCTAssertEqual(transaction.denomination?.rate, "1.00", "Failed: Wrong transaction denomination rate.")
XCTAssertEqual(transaction.destination?.accountId, "fuz", "Failed: Wrong transaction destination accountId.")
XCTAssertEqual(transaction.destination?.accountType, "buz", "Failed: Wrong transaction destination accountType.")
XCTAssertEqual(transaction.destination?.amount, "0.1", "Failed: Wrong transaction destination amount.")
XCTAssertEqual(transaction.destination?.base, "0.1", "Failed: Wrong transaction destination base.")
XCTAssertEqual(transaction.destination?.commission, "0.00", "Failed: Wrong transaction destination commission.")
XCTAssertEqual(transaction.destination?.currency, "BTC", "Failed: Wrong transaction destination currency.")
XCTAssertEqual(transaction.destination?.description, "[email protected]", "Failed: Wrong transaction destination description.")
XCTAssertEqual(transaction.destination?.fee, "0.00", "Failed: Wrong transaction destination fee.")
XCTAssertEqual(transaction.destination?.rate, "1.00", "Failed: Wrong transaction destination rate.")
XCTAssertEqual(transaction.destination?.type, "email", "Failed: Wrong transaction destination type.")
XCTAssertEqual(transaction.denomination!.amount, "0.1", "Failed: Wrong transaction denomination amount.")
XCTAssertEqual(transaction.denomination!.currency, "BTC", "Failed: Wrong transaction denomination currency.")
XCTAssertEqual(transaction.denomination!.pair, "BTCBTC", "Failed: Wrong transaction denomination pair.")
XCTAssertEqual(transaction.denomination!.rate, "1.00", "Failed: Wrong transaction denomination rate.")
XCTAssertEqual(transaction.destination!.accountId, "fuz", "Failed: Wrong transaction destination accountId.")
XCTAssertEqual(transaction.destination!.accountType, "buz", "Failed: Wrong transaction destination accountType.")
XCTAssertEqual(transaction.destination!.amount, "0.1", "Failed: Wrong transaction destination amount.")
XCTAssertEqual(transaction.destination!.base, "0.1", "Failed: Wrong transaction destination base.")
XCTAssertEqual(transaction.destination!.commission, "0.00", "Failed: Wrong transaction destination commission.")
XCTAssertEqual(transaction.destination!.currency, "BTC", "Failed: Wrong transaction destination currency.")
XCTAssertEqual(transaction.destination!.description, "[email protected]", "Failed: Wrong transaction destination description.")
XCTAssertEqual(transaction.destination!.fee, "0.00", "Failed: Wrong transaction destination fee.")
XCTAssertEqual(transaction.destination!.rate, "1.00", "Failed: Wrong transaction destination rate.")
XCTAssertEqual(transaction.destination!.type, "email", "Failed: Wrong transaction destination type.")
XCTAssertEqual(transaction.id, "foobar", "Failed: Wrong transaction id.")
XCTAssertEqual(transaction.message, "foobar", "Failed: Wrong transaction message.")
XCTAssertEqual(transaction.normalized!.count, 1, "Failed: Wrong transaction normalized count.")
Expand All @@ -137,25 +137,25 @@ class CardTest: UpholdTestCase {
XCTAssertEqual(transaction.normalized![0].currency, "BTC", "Failed: Wrong transaction normalized currency.")
XCTAssertEqual(transaction.normalized![0].fee, "1.00", "Failed: Wrong transaction normalized fee.")
XCTAssertEqual(transaction.normalized![0].rate, "2.00", "Failed: Wrong transaction normalized rate.")
XCTAssertEqual(transaction.origin?.accountId, "fiz", "Failed: Wrong transaction origin accountId.")
XCTAssertEqual(transaction.origin?.cardId, "bar", "Failed: Wrong transaction origin cardId.")
XCTAssertEqual(transaction.origin?.accountType, "biz", "Failed: Wrong transaction origin accountType.")
XCTAssertEqual(transaction.origin?.amount, "0.1", "Failed: Wrong transaction origin amount.")
XCTAssertEqual(transaction.origin?.base, "0.1", "Failed: Wrong transaction origin base.")
XCTAssertEqual(transaction.origin?.commission, "0.00", "Failed: Wrong transaction origin comission.")
XCTAssertEqual(transaction.origin?.currency, "BTC", "Failed: Wrong transaction origin currency.")
XCTAssertEqual(transaction.origin?.description, "Foo Bar", "Failed: Wrong transaction origin description.")
XCTAssertEqual(transaction.origin?.fee, "0.00", "Failed: Wrong transaction origin fee.")
XCTAssertEqual(transaction.origin?.rate, "1.00", "Failed: Wrong transaction origin rate.")
XCTAssertEqual(transaction.origin?.type, "card", "Failed: Wrong transaction origin type.")
XCTAssertEqual(transaction.origin?.username, "foobar", "Failed: Wrong transaction origin username.")
XCTAssertEqual(transaction.params?.currency, "BTC", "Failed: Wrong transaction parameter currency.")
XCTAssertEqual(transaction.params?.margin, "0.00", "Failed: Wrong transaction parameter margin.")
XCTAssertEqual(transaction.params?.pair, "BTCBTC", "Failed: Wrong transaction parameter pair.")
XCTAssertEqual(transaction.params?.rate, "1.00", "Failed: Wrong transaction parameter rate.")
XCTAssertEqual(transaction.params?.refunds, "fizbiz", "Failed: Wrong transaction parameter refunds.")
XCTAssertEqual(transaction.params?.ttl, 30000, "Failed: Wrong transaction parameter ttl.")
XCTAssertEqual(transaction.params?.type, "invite", "Failed: Wrong transaction parameter type.")
XCTAssertEqual(transaction.origin!.accountId, "fiz", "Failed: Wrong transaction origin accountId.")
XCTAssertEqual(transaction.origin!.cardId, "bar", "Failed: Wrong transaction origin cardId.")
XCTAssertEqual(transaction.origin!.accountType, "biz", "Failed: Wrong transaction origin accountType.")
XCTAssertEqual(transaction.origin!.amount, "0.1", "Failed: Wrong transaction origin amount.")
XCTAssertEqual(transaction.origin!.base, "0.1", "Failed: Wrong transaction origin base.")
XCTAssertEqual(transaction.origin!.commission, "0.00", "Failed: Wrong transaction origin comission.")
XCTAssertEqual(transaction.origin!.currency, "BTC", "Failed: Wrong transaction origin currency.")
XCTAssertEqual(transaction.origin!.description, "Foo Bar", "Failed: Wrong transaction origin description.")
XCTAssertEqual(transaction.origin!.fee, "0.00", "Failed: Wrong transaction origin fee.")
XCTAssertEqual(transaction.origin!.rate, "1.00", "Failed: Wrong transaction origin rate.")
XCTAssertEqual(transaction.origin!.type, "card", "Failed: Wrong transaction origin type.")
XCTAssertEqual(transaction.origin!.username, "foobar", "Failed: Wrong transaction origin username.")
XCTAssertEqual(transaction.params!.currency, "BTC", "Failed: Wrong transaction parameter currency.")
XCTAssertEqual(transaction.params!.margin, "0.00", "Failed: Wrong transaction parameter margin.")
XCTAssertEqual(transaction.params!.pair, "BTCBTC", "Failed: Wrong transaction parameter pair.")
XCTAssertEqual(transaction.params!.rate, "1.00", "Failed: Wrong transaction parameter rate.")
XCTAssertEqual(transaction.params!.refunds, "fizbiz", "Failed: Wrong transaction parameter refunds.")
XCTAssertEqual(transaction.params!.ttl, 30000, "Failed: Wrong transaction parameter ttl.")
XCTAssertEqual(transaction.params!.type, "invite", "Failed: Wrong transaction parameter type.")
XCTAssertEqual(transaction.refundedById, "foobiz", "Failed: Wrong transaction refundedById.")
XCTAssertEqual(transaction.status, "pending", "Failed: Wrong transaction status.")
XCTAssertEqual(transaction.type, "transfer", "Failed: Wrong transaction type.")
Expand Down
52 changes: 26 additions & 26 deletions Tests/Integration/Model/ReserveTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ class ReserveTest: UpholdTestCase {

reserve.getLedger(0, end: 5).then { (deposits: [Deposit]) -> () in
XCTAssertEqual(deposits[0].createdAt, "2015-04-20T14:57:12.398Z", "Failed: DepositMovement in currency didn't match.")
XCTAssertEqual(deposits[0].input?.amount, "foobiz", "Failed: DepositMovement in amount didn't match.")
XCTAssertEqual(deposits[0].input?.currency, "fiz", "Failed: DepositMovement in currency didn't match.")
XCTAssertEqual(deposits[0].output?.amount, "foobar", "Failed: DepositMovement out amount didn't match.")
XCTAssertEqual(deposits[0].output?.currency, "fuz", "Failed: DepositMovement out currency didn't match.")
XCTAssertEqual(deposits[0].input!.amount, "foobiz", "Failed: DepositMovement in amount didn't match.")
XCTAssertEqual(deposits[0].input!.currency, "fiz", "Failed: DepositMovement in currency didn't match.")
XCTAssertEqual(deposits[0].output!.amount, "foobar", "Failed: DepositMovement out amount didn't match.")
XCTAssertEqual(deposits[0].output!.currency, "fuz", "Failed: DepositMovement out currency didn't match.")
XCTAssertEqual(deposits[0].type, "foo", "Failed: Deposit type didn't match.")
XCTAssertEqual(deposits[1].createdAt, "2015-04-21T14:57:12.398Z", "Failed: CreatedAt didn't match.")
XCTAssertEqual(deposits[1].input?.amount, "foobar", "Failed: DepositMovement in amount didn't match.")
XCTAssertEqual(deposits[1].input?.currency, "biz", "Failed: DepositMovement in currency didn't match.")
XCTAssertEqual(deposits[1].output?.amount, "foobiz", "Failed: DepositMovement out amount didn't match.")
XCTAssertEqual(deposits[1].output?.currency, "buz", "Failed: DepositMovement out currency didn't match.")
XCTAssertEqual(deposits[1].input!.amount, "foobar", "Failed: DepositMovement in amount didn't match.")
XCTAssertEqual(deposits[1].input!.currency, "biz", "Failed: DepositMovement in currency didn't match.")
XCTAssertEqual(deposits[1].output!.amount, "foobiz", "Failed: DepositMovement out amount didn't match.")
XCTAssertEqual(deposits[1].output!.currency, "buz", "Failed: DepositMovement out currency didn't match.")
XCTAssertEqual(deposits[1].transactionId, "foobar", "Failed: TransactionId didn't match.")
XCTAssertEqual(deposits[1].type, "bar", "Failed: Deposit type didn't match.")

Expand Down Expand Up @@ -93,23 +93,23 @@ class ReserveTest: UpholdTestCase {

reserve.getStatistics().then { (statistics: [ReserveStatistics]) -> () in
XCTAssertEqual(statistics[0].currency, "FOO", "Failed: Currency didn't match.")
XCTAssertEqual(statistics[0].totals?.assets, "foobar", "Failed: Totals assets didn't match.")
XCTAssertEqual(statistics[0].totals?.commissions, "foo", "Failed: Totals comissions didn't match.")
XCTAssertEqual(statistics[0].totals?.transactions, "bar", "Failed: Totals transactions didn't match.")
XCTAssertEqual(statistics[0].totals?.liabilities, "foobiz", "Failed: Totals liabilities didn't match.")
XCTAssertEqual(statistics[0].values?.first?.assets, "foobar", "Failed: Values assests didn't match.")
XCTAssertEqual(statistics[0].values?.first?.currency, "foo", "Failed: Values currency didn't match.")
XCTAssertEqual(statistics[0].values?.first?.liabilities, "bar", "Failed: Values liabilities didn't match.")
XCTAssertEqual(statistics[0].values?.first?.rate, "biz", "Failed: Values rate didn't match.")
XCTAssertEqual(statistics[0].totals!.assets, "foobar", "Failed: Totals assets didn't match.")
XCTAssertEqual(statistics[0].totals!.commissions, "foo", "Failed: Totals comissions didn't match.")
XCTAssertEqual(statistics[0].totals!.transactions, "bar", "Failed: Totals transactions didn't match.")
XCTAssertEqual(statistics[0].totals!.liabilities, "foobiz", "Failed: Totals liabilities didn't match.")
XCTAssertEqual(statistics[0].values!.first!.assets, "foobar", "Failed: Values assests didn't match.")
XCTAssertEqual(statistics[0].values!.first!.currency, "foo", "Failed: Values currency didn't match.")
XCTAssertEqual(statistics[0].values!.first!.liabilities, "bar", "Failed: Values liabilities didn't match.")
XCTAssertEqual(statistics[0].values!.first!.rate, "biz", "Failed: Values rate didn't match.")
XCTAssertEqual(statistics[1].currency, "BAR", "Failed: Currency didn't match.")
XCTAssertEqual(statistics[1].totals?.assets, "fuz", "Failed: Totals assets didn't match.")
XCTAssertEqual(statistics[1].totals?.commissions, "fiz", "Failed: Totals comissions didn't match.")
XCTAssertEqual(statistics[1].totals?.transactions, "biz", "Failed: Totals transactions didn't match.")
XCTAssertEqual(statistics[1].totals?.liabilities, "buz", "Failed: Totals liabilities didn't match.")
XCTAssertEqual(statistics[1].values?.first?.assets, "foobiz", "Failed: Values assests didn't match.")
XCTAssertEqual(statistics[1].values?.first?.currency, "biz", "Failed: Values currency didn't match.")
XCTAssertEqual(statistics[1].values?.first?.liabilities, "buz", "Failed: Values liabilities didn't match.")
XCTAssertEqual(statistics[1].values?.first?.rate, "foo", "Failed: Values rate didn't match.")
XCTAssertEqual(statistics[1].totals!.assets, "fuz", "Failed: Totals assets didn't match.")
XCTAssertEqual(statistics[1].totals!.commissions, "fiz", "Failed: Totals comissions didn't match.")
XCTAssertEqual(statistics[1].totals!.transactions, "biz", "Failed: Totals transactions didn't match.")
XCTAssertEqual(statistics[1].totals!.liabilities, "buz", "Failed: Totals liabilities didn't match.")
XCTAssertEqual(statistics[1].values!.first!.assets, "foobiz", "Failed: Values assests didn't match.")
XCTAssertEqual(statistics[1].values!.first!.currency, "biz", "Failed: Values currency didn't match.")
XCTAssertEqual(statistics[1].values!.first!.liabilities, "buz", "Failed: Values liabilities didn't match.")
XCTAssertEqual(statistics[1].values!.first!.rate, "foo", "Failed: Values rate didn't match.")

expectation.fulfill()
}
Expand Down Expand Up @@ -139,8 +139,8 @@ class ReserveTest: UpholdTestCase {
reserve.adapter = MockRestAdapter(body: json)

reserve.getTransactions(0, end: 5).then { (transaction: [Transaction]) -> () in
XCTAssertEqual(transaction.first?.id, "foobar", "Failed: TransactionId didn't match.")
XCTAssertEqual(transaction.last?.id, "foobiz", "Failed: TransactionId didn't match.")
XCTAssertEqual(transaction.first!.id, "foobar", "Failed: TransactionId didn't match.")
XCTAssertEqual(transaction.last!.id, "foobiz", "Failed: TransactionId didn't match.")

expectation.fulfill()
}
Expand Down
4 changes: 2 additions & 2 deletions Tests/Integration/Model/UserTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ class UserTest: UpholdTestCase {
XCTAssertEqual(contact[0].addresses!.count, 1, "Failed: Wrong number of addresses.")
XCTAssertEqual(contact[0].addresses![0], "FooBar FooBiz", "Failed: Wrong contact object.")
XCTAssertEqual(contact[0].company, "biz", "Failed: Wrong contact object.")
XCTAssertEqual(contact[0].emails?.count, 1, "Failed: Wrong contact object.")
XCTAssertEqual(contact[0].emails!.count, 1, "Failed: Wrong contact object.")
XCTAssertEqual(contact[0].emails![0], "[email protected]", "Failed: Wrong contact object.")
XCTAssertEqual(contact[0].firstName, "Foo", "Failed: Wrong contact object.")
XCTAssertEqual(contact[0].id, "foobar", "Failed: Wrong contact object.")
Expand All @@ -335,7 +335,7 @@ class UserTest: UpholdTestCase {
XCTAssertEqual(contact[1].addresses!.count, 1, "Failed: Wrong number of addresses.")
XCTAssertEqual(contact[1].addresses![0], "FizBiz FooBiz", "Failed: Wrong contact object.")
XCTAssertEqual(contact[1].company, "fiz", "Failed: Wrong contact object.")
XCTAssertEqual(contact[1].emails?.count, 1, "Failed: Wrong contact object.")
XCTAssertEqual(contact[1].emails!.count, 1, "Failed: Wrong contact object.")
XCTAssertEqual(contact[1].emails![0], "[email protected]", "Failed: Wrong contact object.")
XCTAssertEqual(contact[1].firstName, "Fuz", "Failed: Wrong contact object.")
XCTAssertEqual(contact[1].id, "fizbar", "Failed: Wrong contact object.")
Expand Down

0 comments on commit be69a4e

Please sign in to comment.