Beispiel #1
0
        // Upserts collections to privateStore
        private void SetUp(MarketplaceRPServiceClient client)
        {
            // Check privateStore exist
            var privateStore = client.PrivateStore.Get(PrivateStoreId);

            Assert.NotNull(privateStore);

            // Clean test collection if exist
            try
            {
                client.PrivateStoreCollection.Delete(PrivateStoreId, collectionId);
            }
            catch (Exception ex)
            {
                if (!ex.Message.Contains("NotFound"))
                {
                    throw;
                }
            }

            try
            {
                client.PrivateStoreCollection.Delete(PrivateStoreId, TargetcollectionId);
            }
            catch (Exception ex)
            {
                if (!ex.Message.Contains("NotFound"))
                {
                    throw;
                }
            }
            // Create Test Collections
            Collection testCollection = new Collection
            {
                CollectionName    = TestCollectionName,
                AllSubscriptions  = false,
                SubscriptionsList = new List <string> {
                    testSubscription
                }
            };

            Collection targetTestCollection = new Collection
            {
                CollectionName    = TargetTestCollectionName,
                AllSubscriptions  = false,
                SubscriptionsList = new List <string> {
                    testSubscription
                }
            };

            client.PrivateStoreCollection.CreateOrUpdate(PrivateStoreId, collectionId, testCollection);
            client.PrivateStoreCollection.CreateOrUpdate(PrivateStoreId, TargetcollectionId, targetTestCollection);
        }
Beispiel #2
0
 // Delete collections from private store
 private void CleanUp(MarketplaceRPServiceClient client)
 {
     // Deleting test collections
     client.PrivateStoreCollection.Delete(PrivateStoreId, collectionId);
     client.PrivateStoreCollection.Delete(PrivateStoreId, TargetcollectionId);
 }