@@ -4,55 +4,30 @@ import XCTest
44
55class CardPresentConfigurationTests : XCTestCase {
66 // MARK: - US Tests
7- func test_configuration_for_US_with_Stripe_enabled_Canada_enabled ( ) throws {
8- let configuration = try CardPresentPaymentsConfiguration ( country: " US " , stripeEnabled : true , canadaEnabled: true )
7+ func test_configuration_for_US_with_Canada_enabled ( ) throws {
8+ let configuration = try CardPresentPaymentsConfiguration ( country: " US " , canadaEnabled: true )
99 XCTAssertEqual ( configuration. currencies, [ Constants . Currency. usd] )
1010 XCTAssertEqual ( configuration. paymentGateways, [ Constants . PaymentGateway. wcpay, Constants . PaymentGateway. stripe] )
1111 XCTAssertEqual ( configuration. paymentMethods, [ . cardPresent] )
1212 }
1313
14- func test_configuration_for_US_with_Stripe_enabled_Canada_disabled ( ) throws {
15- let configuration = try CardPresentPaymentsConfiguration ( country: " US " , stripeEnabled : true , canadaEnabled: false )
14+ func test_configuration_for_US_with_Canada_disabled ( ) throws {
15+ let configuration = try CardPresentPaymentsConfiguration ( country: " US " , canadaEnabled: false )
1616 XCTAssertEqual ( configuration. currencies, [ Constants . Currency. usd] )
1717 XCTAssertEqual ( configuration. paymentGateways, [ Constants . PaymentGateway. wcpay, Constants . PaymentGateway. stripe] )
1818 XCTAssertEqual ( configuration. paymentMethods, [ . cardPresent] )
1919 }
2020
21- func test_configuration_for_US_with_Stripe_disabled_Canada_enabled( ) throws {
22- let configuration = try CardPresentPaymentsConfiguration ( country: " US " , stripeEnabled: false , canadaEnabled: true )
23- XCTAssertEqual ( configuration. currencies, [ Constants . Currency. usd] )
24- XCTAssertEqual ( configuration. paymentGateways, [ Constants . PaymentGateway. wcpay] )
25- XCTAssertEqual ( configuration. paymentMethods, [ . cardPresent] )
26- }
27-
28- func test_configuration_for_US_with_Stripe_disabled_Canada_disabled( ) throws {
29- let configuration = try CardPresentPaymentsConfiguration ( country: " US " , stripeEnabled: false , canadaEnabled: false )
30- XCTAssertEqual ( configuration. currencies, [ Constants . Currency. usd] )
31- XCTAssertEqual ( configuration. paymentGateways, [ Constants . PaymentGateway. wcpay] )
32- XCTAssertEqual ( configuration. paymentMethods, [ . cardPresent] )
33- }
34-
3521 // MARK: - Canada Tests
36- func test_configuration_for_Canada_with_Stripe_enabled_Canada_enabled( ) throws {
37- let configuration = try CardPresentPaymentsConfiguration ( country: " CA " , stripeEnabled: true , canadaEnabled: true )
38- XCTAssertEqual ( configuration. currencies, [ Constants . Currency. cad] )
39- XCTAssertEqual ( configuration. paymentGateways, [ Constants . PaymentGateway. wcpay] )
40- XCTAssertEqual ( configuration. paymentMethods, [ . cardPresent, . interacPresent] )
41- }
42-
43- func test_configuration_for_Canada_with_Stripe_enabled_Canada_disabled( ) {
44- XCTAssertThrowsError ( try CardPresentPaymentsConfiguration ( country: " CA " , stripeEnabled: true , canadaEnabled: false ) )
45- }
46-
47- func test_configuration_for_Canada_with_Stripe_disabled_Canada_enabled( ) throws {
48- let configuration = try CardPresentPaymentsConfiguration ( country: " CA " , stripeEnabled: false , canadaEnabled: true )
22+ func test_configuration_for_Canada_with_Canada_enabled( ) throws {
23+ let configuration = try CardPresentPaymentsConfiguration ( country: " CA " , canadaEnabled: true )
4924 XCTAssertEqual ( configuration. currencies, [ Constants . Currency. cad] )
5025 XCTAssertEqual ( configuration. paymentGateways, [ Constants . PaymentGateway. wcpay] )
5126 XCTAssertEqual ( configuration. paymentMethods, [ . cardPresent, . interacPresent] )
5227 }
5328
54- func test_configuration_for_Canada_with_Stripe_disabled_Canada_disabled ( ) throws {
55- XCTAssertThrowsError ( try CardPresentPaymentsConfiguration ( country: " CA " , stripeEnabled : false , canadaEnabled: false ) )
29+ func test_configuration_for_Canada_with_Canada_disabled ( ) {
30+ XCTAssertThrowsError ( try CardPresentPaymentsConfiguration ( country: " CA " , canadaEnabled: false ) )
5631 }
5732
5833 private enum Constants {
0 commit comments