Exemplo n.º 1
0
        public async Task InitializeAsync()
        {
            var policy = new SmartRetryExecutionPolicy();

            Service.SetExecutionPolicy(policy);
            CustomCollectionService.SetExecutionPolicy(policy);
            ProductService.SetExecutionPolicy(policy);

            // Create a custom collection to use with these tests.
            var collection = await CustomCollectionService.CreateAsync(new CustomCollection()
            {
                Title     = "Things",
                Published = false,
                BodyHtml  = "<h1>Hello from ShopifySharp</h1>",
                Image     = new CustomCollectionImage()
                {
                    Src = "http://placehold.it/250x250"
                }
            });

            CollectionId = collection.Id.Value;

            // Create a collection to use with get, list, count, etc. tests.
            await Create();
        }
Exemplo n.º 2
0
        public async Task InitializeAsync()
        {
            var policy = new SmartRetryExecutionPolicy();

            DiscountCodeService.SetExecutionPolicy(policy);
            PriceRuleService.SetExecutionPolicy(policy);

            // Create one for count, list, get, etc. orders.
            await Create(Code);
        }
Exemplo n.º 3
0
        public async Task InitializeAsync()
        {
            var policy = new SmartRetryExecutionPolicy();

            Service.SetExecutionPolicy(policy);
            ThemeService.SetExecutionPolicy(policy);

            var themes = await ThemeService.ListAsync();

            ThemeId = themes.First().Id.Value;
        }
Exemplo n.º 4
0
        public async Task InitializeAsync()
        {
            var policy = new SmartRetryExecutionPolicy();

            Service.SetExecutionPolicy(policy);
            OrderService.SetExecutionPolicy(policy);

            // Create one collection for use with count, list, get, etc. tests.
            var order = await CreateOrder();

            await Create(order.Id.Value);
        }
Exemplo n.º 5
0
        public async Task InitializeAsync()
        {
            // Fulfillment API has a stricter rate limit when on a non-paid store.
            var policy = new SmartRetryExecutionPolicy(false);

            FulfillmentService.SetExecutionPolicy(policy);
            OrderService.SetExecutionPolicy(policy);

            // Create an order and fulfillment for count, list, get, etc. tests.
            var order = await CreateOrder();

            var fulfillment = await CreateFulfillment(order.Id.Value);
        }
Exemplo n.º 6
0
        public async Task InitializeAsync()
        {
            var policy = new SmartRetryExecutionPolicy();

            Service.SetExecutionPolicy(policy);
            CustomerService.SetExecutionPolicy(policy);

            var customers = await CustomerService.ListAsync();

            CustomerId = customers.Items.First().Id;

            // Create at least one Address for list, count, etc commands.
            //await Create();
        }
Exemplo n.º 7
0
        public async Task InitializeAsync()
        {
            var policy = new SmartRetryExecutionPolicy();

            Service.SetExecutionPolicy(policy);
            BlogService.SetExecutionPolicy(policy);

            var blogs = await BlogService.ListAsync();

            BlogId = blogs.Items.First().Id;

            // Create at least one article for list, count, etc commands.
            await Create();
        }
Exemplo n.º 8
0
        public async Task InitializeAsync()
        {
            var policy = new SmartRetryExecutionPolicy();

            Service.SetExecutionPolicy(policy);
            OrderService.SetExecutionPolicy(policy);

            OrderId = (await OrderService.ListAsync(new OrderFilter()
            {
                Limit = 1
            })).First().Id.Value;

            // Create a risk for count, list, get, etc. tests.
            await Create(OrderId);
        }
Exemplo n.º 9
0
        public async Task InitializeAsync()
        {
            var policy = new SmartRetryExecutionPolicy(false);

            OrderService.SetExecutionPolicy(policy);
            Service.SetExecutionPolicy(policy);

            if (!OrderId.HasValue)
            {
                return;
            }

            // Retrieve an order for count, list, get, etc. orders.
            await Retrieve(OrderId.Value);
        }
Exemplo n.º 10
0
        public async Task InitializeAsync()
        {
            var policy = new SmartRetryExecutionPolicy();

            Service.SetExecutionPolicy(policy);
            ProductService.SetExecutionPolicy(policy);

            // Get a product to use as the parent for all images.
            ProductId = (await ProductService.ListAsync(new ProductListFilter()
            {
                Limit = 1
            })).Items.First().Id.Value;

            // Create one for count, list, get, etc. orders.
            await Create();
        }
Exemplo n.º 11
0
        public async Task InitializeAsync()
        {
            var policy = new SmartRetryExecutionPolicy();

            Service.SetExecutionPolicy(policy);
            ProductService.SetExecutionPolicy(policy);

            // Get a product id to use with these tests.
            ProductId = (await ProductService.ListAsync(new ProductListFilter()
            {
                Limit = 1
            })).Items.First().Id.Value;

            // Create one for use with count, list, get, etc. tests.
            await Create();
        }
Exemplo n.º 12
0
        public async Task InitializeAsync()
        {
            var policy = new SmartRetryExecutionPolicy();

            Service.SetExecutionPolicy(policy);
            VariantService.SetExecutionPolicy(policy);

            // Get a product id to use with these tests.
            ProductId = (await new ProductService(Utils.MyShopifyUrl, Utils.AccessToken).ListAsync(new ProductFilter()
            {
                Limit = 1
            })).First().Id.Value;

            // Create one for use with count, list, get, etc. tests.
            await Create();
        }
        public async Task InitializeAsync()
        {
            var policy = new SmartRetryExecutionPolicy();

            Service.SetExecutionPolicy(policy);
            GiftCardService.SetExecutionPolicy(policy);

            // Get a gift card id to use with these tests.
            GiftCardId = (await GiftCardService.ListAsync(new Filters.GiftCardListFilter()
            {
                Limit = 1
            })).Items.First().Id.Value;

            // Create one for use with count, list, get, etc. tests.
            await Create();
        }
Exemplo n.º 14
0
        public async Task InitializeAsync()
        {
            var policy = new SmartRetryExecutionPolicy();

            Service.SetExecutionPolicy(policy);
            ProductService.SetExecutionPolicy(policy);

            // Get a product to add metafields to.
            var products = await ProductService.ListAsync();

            ResourceId      = products.First().Id.Value;
            ChildResourceId = products.First().Variants.First().Id.Value;

            // Create a metafield for use in count, list, get, etc. tests.
            await Create();
            await Create(ResourceId, ResourceType);
            await Create(ChildResourceId, ChildResourceType, ResourceId, ResourceType);
        }
        public async Task InitializeAsync()
        {
            var policy = new SmartRetryExecutionPolicy();

            Service.SetExecutionPolicy(policy);
        }