Exemple #1
0
        public void CollectionsToSubscriptionsMappingTest()
        {
            using (var context = MockContext.Start(this.GetType()))
            {
                using (var client = context.GetServiceClient <MarketplaceRPServiceClient>())
                {
                    SetUp(client);

                    // Check collection to subscription mapping
                    CollectionsToSubscriptionsMappingProperties collectionsToSubscriptionsMappingProperties = new CollectionsToSubscriptionsMappingProperties
                    {
                        SubscriptionIds = new List <string>()
                        {
                            testSubscription
                        }
                    };
                    CollectionsToSubscriptionsMappingPayload collectionsToSubscriptionsMappingPayload = new CollectionsToSubscriptionsMappingPayload
                    {
                        Properties = collectionsToSubscriptionsMappingProperties
                    };
                    var collectionToSubscriptionMapping = client.PrivateStore.CollectionsToSubscriptionsMapping(PrivateStoreId, collectionsToSubscriptionsMappingPayload);
                    Assert.Equal(testSubscription, collectionToSubscriptionMapping.Details[collectionId].Subscriptions.First());

                    CleanUp(client);
                }
            }
        }
 /// <summary>
 /// For a given subscriptions list, the API will return a map of collections
 /// and the related subscriptions from the supplied list.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='privateStoreId'>
 /// The store ID - must use the tenant ID
 /// </param>
 /// <param name='payload'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <CollectionsToSubscriptionsMappingResponse> CollectionsToSubscriptionsMappingAsync(this IPrivateStoreOperations operations, string privateStoreId, CollectionsToSubscriptionsMappingPayload payload = default(CollectionsToSubscriptionsMappingPayload), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CollectionsToSubscriptionsMappingWithHttpMessagesAsync(privateStoreId, payload, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// For a given subscriptions list, the API will return a map of collections
 /// and the related subscriptions from the supplied list.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='privateStoreId'>
 /// The store ID - must use the tenant ID
 /// </param>
 /// <param name='payload'>
 /// </param>
 public static CollectionsToSubscriptionsMappingResponse CollectionsToSubscriptionsMapping(this IPrivateStoreOperations operations, string privateStoreId, CollectionsToSubscriptionsMappingPayload payload = default(CollectionsToSubscriptionsMappingPayload))
 {
     return(operations.CollectionsToSubscriptionsMappingAsync(privateStoreId, payload).GetAwaiter().GetResult());
 }