From 1404a8578fe1f984048a40947b6f14fc40e56a22 Mon Sep 17 00:00:00 2001 From: Anthony Castelli Date: Mon, 29 May 2017 10:06:55 -0700 Subject: [PATCH] formatting: Fix up a few { } --- Tests/StripeTests/BalanceTests.swift | 7 ++----- Tests/StripeTests/ChargeTests.swift | 7 ++----- Tests/StripeTests/CouponTests.swift | 24 +++++++----------------- Tests/StripeTests/CustomerTests.swift | 7 ++----- Tests/StripeTests/RefundTests.swift | 7 ++----- Tests/StripeTests/TokenTests.swift | 10 +++------- 6 files changed, 18 insertions(+), 44 deletions(-) diff --git a/Tests/StripeTests/BalanceTests.swift b/Tests/StripeTests/BalanceTests.swift index 6c15088..4653ea9 100644 --- a/Tests/StripeTests/BalanceTests.swift +++ b/Tests/StripeTests/BalanceTests.swift @@ -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", @@ -35,9 +34,7 @@ class BalanceTests: XCTestCase { description: "Vapor Stripe: Test Description") .serializedResponse() .balanceTransactionId ?? "" - } - catch - { + } catch { fatalError("Setup failed: \(error.localizedDescription)") } } diff --git a/Tests/StripeTests/ChargeTests.swift b/Tests/StripeTests/ChargeTests.swift index 192cdb7..667cdea 100644 --- a/Tests/StripeTests/ChargeTests.swift +++ b/Tests/StripeTests/ChargeTests.swift @@ -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", @@ -35,9 +34,7 @@ class ChargeTests: XCTestCase { for: .source(tokenId), description: "Vapor Stripe: Test Description") .serializedResponse().id ?? "" - } - catch - { + } catch { fatalError("Setup failed: \(error.localizedDescription)") } } diff --git a/Tests/StripeTests/CouponTests.swift b/Tests/StripeTests/CouponTests.swift index b7dc0b6..4e734c9 100644 --- a/Tests/StripeTests/CouponTests.swift +++ b/Tests/StripeTests/CouponTests.swift @@ -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, @@ -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)") } } @@ -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") } } @@ -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") } } diff --git a/Tests/StripeTests/CustomerTests.swift b/Tests/StripeTests/CustomerTests.swift index 29d03a5..bed487e 100644 --- a/Tests/StripeTests/CustomerTests.swift +++ b/Tests/StripeTests/CustomerTests.swift @@ -19,8 +19,7 @@ class CustomerTests: XCTestCase { var customerId: String = "" override func setUp() { - do - { + do { drop = try self.makeDroplet() let customer = Customer() @@ -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)") } } diff --git a/Tests/StripeTests/RefundTests.swift b/Tests/StripeTests/RefundTests.swift index 38f8d1a..73f67f8 100644 --- a/Tests/StripeTests/RefundTests.swift +++ b/Tests/StripeTests/RefundTests.swift @@ -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", @@ -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)") } } diff --git a/Tests/StripeTests/TokenTests.swift b/Tests/StripeTests/TokenTests.swift index aeca7dc..180c72e 100644 --- a/Tests/StripeTests/TokenTests.swift +++ b/Tests/StripeTests/TokenTests.swift @@ -18,8 +18,7 @@ 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", @@ -27,15 +26,12 @@ class TokenTests: XCTestCase { 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,