@@ -616,9 +616,11 @@ class IterableAPITests: XCTestCase {
616616
617617 func testUpdateSubscriptions( ) {
618618 let expectation1 = expectation ( description: " update subscriptions " )
619- let emailListIds = [ " user1@example.com " ]
620- let unsubscriptedChannelIds = [ " channedl1 " , " channel2 " ]
621- let unsubscribedMessageTypeIds = [ " messageType1 " , " messageType2 " ]
619+ let emailListIds = [ NSNumber ( value: 382 ) ]
620+ let unsubscriptedChannelIds = [ NSNumber ( value: 7845 ) , NSNumber ( value: 1048 ) ]
621+ let unsubscribedMessageTypeIds = [ NSNumber ( value: 5671 ) , NSNumber ( value: 9087 ) ]
622+ let campaignId = NSNumber ( value: 23 )
623+ let templateId = NSNumber ( value: 10 )
622624
623625 let networkSession = MockNetworkSession ( statusCode: 200 )
624626 networkSession. callback = { ( _, _, _) in
@@ -632,12 +634,19 @@ class IterableAPITests: XCTestCase {
632634 TestUtils . validateMatch ( keyPath: KeyPath ( AnyHashable . ITBL_KEY_EMAIL_LIST_IDS) , value: emailListIds, inDictionary: body)
633635 TestUtils . validateMatch ( keyPath: KeyPath ( AnyHashable . ITBL_KEY_UNSUB_CHANNEL) , value: unsubscriptedChannelIds, inDictionary: body)
634636 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)
635639 expectation1. fulfill ( )
636640 }
637641 let config = IterableConfig ( )
638642 TestUtils . getTestUserDefaults ( ) . set ( " user1@example.com " , forKey: . ITBL_USER_DEFAULTS_EMAIL_KEY)
639643 IterableAPI . initializeForTesting ( apiKey: IterableAPITests . apiKey, config: config, networkSession: networkSession)
640- IterableAPI . updateSubscriptions ( emailListIds, unsubscribedChannelIds: unsubscriptedChannelIds, unsubscribedMessageTypeIds: unsubscribedMessageTypeIds)
644+ IterableAPI . updateSubscriptions ( emailListIds,
645+ unsubscribedChannelIds: unsubscriptedChannelIds,
646+ unsubscribedMessageTypeIds: unsubscribedMessageTypeIds,
647+ subscribedMessageTypeIds: nil ,
648+ campaignId: campaignId,
649+ templateId: templateId)
641650 wait ( for: [ expectation1] , timeout: testExpectationTimeout)
642651 }
643652
0 commit comments