@@ -616,9 +616,11 @@ class IterableAPITests: XCTestCase {
616
616
617
617
func testUpdateSubscriptions( ) {
618
618
let expectation1 = expectation ( description: " update subscriptions " )
619
- let emailListIds = [ " [email protected] " ]
620
- let unsubscriptedChannelIds = [ " channedl1 " , " channel2 " ]
621
- let unsubscribedMessageTypeIds = [ " messageType1 " , " messageType2 " ]
619
+ let campaignId = NSNumber ( value: 23 )
620
+ let templateId = NSNumber ( value: 10 )
621
+ let emailListIds = [ NSNumber ( value: 382 ) ]
622
+ let unsubscriptedChannelIds = [ NSNumber ( value: 7845 ) , NSNumber ( value: 1048 ) ]
623
+ let unsubscribedMessageTypeIds = [ NSNumber ( value: 5671 ) , NSNumber ( value: 9087 ) ]
622
624
623
625
let networkSession = MockNetworkSession ( statusCode: 200 )
624
626
networkSession. callback = { ( _, _, _) in
@@ -629,6 +631,8 @@ class IterableAPITests: XCTestCase {
629
631
queryParams: [ ] )
630
632
631
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)
632
636
TestUtils . validateMatch ( keyPath: KeyPath ( AnyHashable . ITBL_KEY_EMAIL_LIST_IDS) , value: emailListIds, inDictionary: body)
633
637
TestUtils . validateMatch ( keyPath: KeyPath ( AnyHashable . ITBL_KEY_UNSUB_CHANNEL) , value: unsubscriptedChannelIds, inDictionary: body)
634
638
TestUtils . validateMatch ( keyPath: KeyPath ( AnyHashable . ITBL_KEY_UNSUB_MESSAGE) , value: unsubscribedMessageTypeIds, inDictionary: body)
@@ -637,7 +641,7 @@ class IterableAPITests: XCTestCase {
637
641
let config = IterableConfig ( )
638
642
TestUtils . getTestUserDefaults ( ) . set ( " [email protected] " , forKey
: . ITBL_USER_DEFAULTS_EMAIL_KEY
)
639
643
IterableAPI . initializeForTesting ( apiKey: IterableAPITests . apiKey, config: config, networkSession: networkSession)
640
- IterableAPI . updateSubscriptions ( emailListIds, unsubscribedChannelIds: unsubscriptedChannelIds, unsubscribedMessageTypeIds: unsubscribedMessageTypeIds)
644
+ IterableAPI . updateSubscriptions ( campaignId : campaignId , templateId : templateId , emailListIds: emailListIds , unsubscribedChannelIds: unsubscriptedChannelIds, unsubscribedMessageTypeIds: unsubscribedMessageTypeIds, subscribedMessageTypeIds : nil )
641
645
wait ( for: [ expectation1] , timeout: testExpectationTimeout)
642
646
}
643
647
0 commit comments