Skip to content

Commit

Permalink
formatting: Fix up a few { }
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonycastelli committed May 29, 2017
1 parent 2602672 commit 1404a85
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 44 deletions.
7 changes: 2 additions & 5 deletions Tests/StripeTests/BalanceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ class BalanceTests: XCTestCase {
var transactionId: String = ""

override func setUp() {
do
{
do {
drop = try self.makeDroplet()

let paymentToken = try drop?.stripe?.tokens.createCard(withCardNumber: "4242 4242 4242 4242",
Expand All @@ -35,9 +34,7 @@ class BalanceTests: XCTestCase {
description: "Vapor Stripe: Test Description")
.serializedResponse()
.balanceTransactionId ?? ""
}
catch
{
} catch {
fatalError("Setup failed: \(error.localizedDescription)")
}
}
Expand Down
7 changes: 2 additions & 5 deletions Tests/StripeTests/ChargeTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ class ChargeTests: XCTestCase {
var chargeId: String = ""

override func setUp() {
do
{
do {
drop = try self.makeDroplet()

let tokenId = try drop?.stripe?.tokens.createCard(withCardNumber: "4242 4242 4242 4242",
Expand All @@ -35,9 +34,7 @@ class ChargeTests: XCTestCase {
for: .source(tokenId),
description: "Vapor Stripe: Test Description")
.serializedResponse().id ?? ""
}
catch
{
} catch {
fatalError("Setup failed: \(error.localizedDescription)")
}
}
Expand Down
24 changes: 7 additions & 17 deletions Tests/StripeTests/CouponTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@ import XCTest
@testable import Helpers
@testable import API

class CouponTests: XCTestCase
{
class CouponTests: XCTestCase {
var drop: Droplet?
var couponId: String = ""

override func setUp() {
do
{
do {
drop = try self.makeDroplet()

couponId = try drop?.stripe?.coupons.create(id: nil,
Expand All @@ -32,9 +30,7 @@ class CouponTests: XCTestCase
percentOff: nil,
redeemBy: Date().addingTimeInterval(3000),
metadata: ["meta":"data"]).serializedResponse().id ?? ""
}
catch
{
} catch {
fatalError("Setup failed: \(error.localizedDescription)")
}
}
Expand Down Expand Up @@ -80,12 +76,9 @@ class CouponTests: XCTestCase

XCTAssertNotNil(coupons)

if let couponItems = coupons?.items
{
if let couponItems = coupons?.items {
XCTAssertGreaterThanOrEqual(couponItems.count, 1)
}
else
{
} else {
XCTFail("Coupons are not present")
}
}
Expand All @@ -99,12 +92,9 @@ class CouponTests: XCTestCase

XCTAssertNotNil(coupons)

if let couponItems = coupons?.items
{
if let couponItems = coupons?.items {
XCTAssertEqual(couponItems.count, 1)
}
else
{
} else {
XCTFail("Coupons are not present")
}
}
Expand Down
7 changes: 2 additions & 5 deletions Tests/StripeTests/CustomerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ class CustomerTests: XCTestCase {
var customerId: String = ""

override func setUp() {
do
{
do {
drop = try self.makeDroplet()

let customer = Customer()
Expand All @@ -30,9 +29,7 @@ class CustomerTests: XCTestCase {
customer.description = "This is a test customer"

customerId = try drop?.stripe?.customer.create(customer: customer).serializedResponse().id ?? ""
}
catch
{
} catch {
fatalError("Setup failed: \(error.localizedDescription)")
}
}
Expand Down
7 changes: 2 additions & 5 deletions Tests/StripeTests/RefundTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ class RefundTests: XCTestCase {
var refundId: String = ""

override func setUp() {
do
{
do {
drop = try self.makeDroplet()

let tokenId = try drop?.stripe?.tokens.createCard(withCardNumber: "4242 4242 4242 4242",
Expand All @@ -34,9 +33,7 @@ class RefundTests: XCTestCase {
description: "Vapor Stripe: Test Description").serializedResponse().id ?? ""

refundId = try drop?.stripe?.refunds.refund(charge: chargeId).serializedResponse().id ?? ""
}
catch
{
} catch {
fatalError("Setup failed: \(error.localizedDescription)")
}
}
Expand Down
10 changes: 3 additions & 7 deletions Tests/StripeTests/TokenTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,20 @@ class TokenTests: XCTestCase {
var tokenId: String = ""

override func setUp() {
do
{
do {
drop = try self.makeDroplet()

tokenId = try drop?.stripe?.tokens.createCard(withCardNumber: "4242 4242 4242 4242",
expirationMonth: 10,
expirationYear: 2018,
cvc: 123,
name: "Test Card").serializedResponse().id ?? ""
}
catch
{
} catch {
fatalError("Setup failed: \(error.localizedDescription)")
}
}

func testTokenCreation() throws
{
func testTokenCreation() throws {
let object = try drop?.stripe?.tokens.createCard(withCardNumber: "4242 4242 4242 4242",
expirationMonth: 10,
expirationYear: 2018,
Expand Down

0 comments on commit 1404a85

Please sign in to comment.