-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Version 2.0: MailchimpSDK.swift to Mailchimp.swift (#51)
* Renamed MailchimpSDK class to Mailchimp.
- Loading branch information
1 parent
0559a66
commit 9413b87
Showing
83 changed files
with
4,676 additions
and
1,253 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ class ContactTests: XCTestCase { | |
var token = "PUT YOUR API TOKEN HERE" | ||
|
||
override func setUp() { | ||
try? MailchimpSDK.initialize(token: token) | ||
try? Mailchimp.initialize(token: token) | ||
} | ||
|
||
func testContactStatus() { | ||
|
@@ -37,7 +37,7 @@ class ContactTests: XCTestCase { | |
|
||
func testSetContactStatus() { | ||
let mockApi = MockAnzeeAPI() | ||
MailchimpSDK.api = mockApi | ||
Mailchimp.api = mockApi | ||
let testEmailAddress = "[email protected]" | ||
let testStatus = Contact.Status.subscribed | ||
|
||
|
@@ -56,7 +56,7 @@ class ContactTests: XCTestCase { | |
|
||
XCTAssertEqual(Contact.Status.subscribed, status) | ||
} | ||
MailchimpSDK.setContactStatus(emailAddress: testEmailAddress, status: testStatus) | ||
Mailchimp.setContactStatus(emailAddress: testEmailAddress, status: testStatus) | ||
} | ||
|
||
func testMarketingPermissions() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// | ||
// AudienceTests.swift | ||
// Mailchimp SDKTests | ||
// MergeFieldTests.swift | ||
// MailchimpSDKTests | ||
// | ||
// Created by Chez Browne on 5/24/19. | ||
// Copyright 2019 The Rocket Science Group LLC | ||
|
@@ -23,7 +23,7 @@ class MergeFieldTests: XCTestCase { | |
var token = "PUT YOUR API TOKEN HERE" | ||
|
||
override func setUp() { | ||
try? MailchimpSDK.initialize(token: token) | ||
try? Mailchimp.initialize(token: token) | ||
} | ||
|
||
func testMergeFields() { | ||
|
@@ -45,7 +45,7 @@ class MergeFieldTests: XCTestCase { | |
|
||
func testCustomMergeFieldString() { | ||
let mockApi = MockAnzeeAPI() | ||
MailchimpSDK.api = mockApi | ||
Mailchimp.api = mockApi | ||
|
||
mockApi.verifyRequest = { request in | ||
guard let contact = request?.contact else { | ||
|
@@ -72,12 +72,12 @@ class MergeFieldTests: XCTestCase { | |
|
||
let fieldName = "Genre" | ||
let favoriteGenre = "Action" | ||
MailchimpSDK.setMergeField(emailAddress: "[email protected]", name: fieldName, value: favoriteGenre) | ||
Mailchimp.setMergeField(emailAddress: "[email protected]", name: fieldName, value: favoriteGenre) | ||
} | ||
|
||
func testCustomMergeFieldAddress() { | ||
let mockApi = MockAnzeeAPI() | ||
MailchimpSDK.api = mockApi | ||
Mailchimp.api = mockApi | ||
|
||
mockApi.verifyRequest = { request in | ||
guard let contact = request?.contact else { | ||
|
@@ -115,7 +115,7 @@ class MergeFieldTests: XCTestCase { | |
state: "GA", | ||
zipCode: "30308", | ||
country: CountryCode.USA) | ||
MailchimpSDK.setMergeField(emailAddress: "[email protected]", name: fieldName, address: address) | ||
Mailchimp.setMergeField(emailAddress: "[email protected]", name: fieldName, address: address) | ||
} | ||
|
||
// MockAnzeeAPI in a class since it's self-mutating | ||
|
Oops, something went wrong.