public void Init()
        {
            instance     = new CatalogApi();
            testAccounts = new TestAccounts();
            var testAccount = testAccounts["US-Prod"];

            Configuration.Default.AccessToken = testAccount.AccessToken;

            try
            {
                var request =
                    new BatchUpsertCatalogObjectsRequest(
                        IdempotencyKey: Guid.NewGuid().ToString(),
                        Batches: new List <CatalogObjectBatch>()
                        );
                request.Batches.Add(new CatalogObjectBatch(Objects: OBJECTS));
                var response = instance.BatchUpsertCatalogObjects(request);
                idMap = response.IdMappings.ToDictionary(
                    keySelector: m => m.ClientObjectId,
                    elementSelector: m => m.ObjectId
                    );
            }
            catch (Exception ex)
            {
                Assert.Fail("Failed to build catalog objects. {0}", ex.ToString());
            }
        }
Esempio n. 2
0
        public void Init()
        {
            instance     = new LocationsApi();
            testAccounts = new TestAccounts();
            var sandboxAccount = testAccounts["US-Prod-Sandbox"];

            Configuration.Default.AccessToken = sandboxAccount.AccessToken;
        }
Esempio n. 3
0
        public void Init()
        {
            instance     = new CheckoutApi();
            testAccounts = new TestAccounts();
            var testAccount = testAccounts["US-Prod-Sandbox"];

            locationId = testAccount.LocationId;
            Configuration.Default.AccessToken = testAccount.AccessToken;
        }
Esempio n. 4
0
        public void Init()
        {
            instance = new ReportingApi();
            var testAccounts = new TestAccounts();
            var account      = testAccounts["Sandbox"];

            locationId = account.LocationId;
            Configuration.Default.AccessToken = account.AccessToken;
        }
        public void Init()
        {
            instance     = new OrdersApi();
            testAccounts = new TestAccounts();
            var testAccount = testAccounts["US-Prod"];

            locationId = testAccount.LocationId;
            Configuration.Default.AccessToken = testAccount.AccessToken;
        }