@@ -616,11 +616,11 @@ class IterableAPITests: XCTestCase {
616
616
617
617
func testUpdateSubscriptions( ) {
618
618
let expectation1 = expectation ( description: " update subscriptions " )
619
- let campaignId = NSNumber ( value: 23 )
620
- let templateId = NSNumber ( value: 10 )
621
619
let emailListIds = [ NSNumber ( value: 382 ) ]
622
620
let unsubscriptedChannelIds = [ NSNumber ( value: 7845 ) , NSNumber ( value: 1048 ) ]
623
621
let unsubscribedMessageTypeIds = [ NSNumber ( value: 5671 ) , NSNumber ( value: 9087 ) ]
622
+ let campaignId = NSNumber ( value: 23 )
623
+ let templateId = NSNumber ( value: 10 )
624
624
625
625
let networkSession = MockNetworkSession ( statusCode: 200 )
626
626
networkSession. callback = { ( _, _, _) in
@@ -631,17 +631,22 @@ class IterableAPITests: XCTestCase {
631
631
queryParams: [ ] )
632
632
633
633
let body = networkSession. getRequestBody ( ) as! [ String : Any ]
634
- TestUtils . validateMatch ( keyPath: KeyPath ( AnyHashable . ITBL_KEY_CAMPAIGN_ID) , value: campaignId, inDictionary: body)
635
- TestUtils . validateMatch ( keyPath: KeyPath ( AnyHashable . ITBL_KEY_TEMPLATE_ID) , value: templateId, inDictionary: body)
636
634
TestUtils . validateMatch ( keyPath: KeyPath ( AnyHashable . ITBL_KEY_EMAIL_LIST_IDS) , value: emailListIds, inDictionary: body)
637
635
TestUtils . validateMatch ( keyPath: KeyPath ( AnyHashable . ITBL_KEY_UNSUB_CHANNEL) , value: unsubscriptedChannelIds, inDictionary: body)
638
636
TestUtils . validateMatch ( keyPath: KeyPath ( AnyHashable . ITBL_KEY_UNSUB_MESSAGE) , value: unsubscribedMessageTypeIds, inDictionary: body)
637
+ TestUtils . validateMatch ( keyPath: KeyPath ( AnyHashable . ITBL_KEY_CAMPAIGN_ID) , value: campaignId, inDictionary: body)
638
+ TestUtils . validateMatch ( keyPath: KeyPath ( AnyHashable . ITBL_KEY_TEMPLATE_ID) , value: templateId, inDictionary: body)
639
639
expectation1. fulfill ( )
640
640
}
641
641
let config = IterableConfig ( )
642
642
TestUtils . getTestUserDefaults ( ) . set ( " [email protected] " , forKey
: . ITBL_USER_DEFAULTS_EMAIL_KEY
)
643
643
IterableAPI . initializeForTesting ( apiKey: IterableAPITests . apiKey, config: config, networkSession: networkSession)
644
- IterableAPI . updateSubscriptions ( campaignId: campaignId, templateId: templateId, emailListIds: emailListIds, unsubscribedChannelIds: unsubscriptedChannelIds, unsubscribedMessageTypeIds: unsubscribedMessageTypeIds, subscribedMessageTypeIds: nil )
644
+ IterableAPI . updateSubscriptions ( emailListIds,
645
+ unsubscribedChannelIds: unsubscriptedChannelIds,
646
+ unsubscribedMessageTypeIds: unsubscribedMessageTypeIds,
647
+ subscribedMessageTypeIds: nil ,
648
+ campaignId: campaignId,
649
+ templateId: templateId)
645
650
wait ( for: [ expectation1] , timeout: testExpectationTimeout)
646
651
}
647
652
0 commit comments