public async Task InitializeAsync()
        {
            // Get a product id to use with these tests.
            var prod = await ProductTest.Create();

            VariantTest.ProductId = prod.Id.Value;
            var variant = prod.Variants.First();

            InventoryItemId             = variant.InventoryItemId.Value;
            variant.SKU                 = "TestSKU"; //To change fulfillment, SKU is required
            variant.InventoryManagement = "Shopify"; //To set inventory, InventoryManagement must be Shopify
            await VariantTest.Service.UpdateAsync(variant.Id.Value, variant);
        }
示例#2
0
        public async Task InitializeAsync()
        {
            Service.SetExecutionPolicy(new LeakyBucketExecutionPolicy());

            // Get a product id to use with these tests.
            var prod = await ProductTest.Create();

            VariantTest.ProductId = prod.Id.Value;
            var variant = prod.Variants.First();

            InventoryItemId = variant.InventoryItemId.Value;
            // Must set variant.InventoryQuantity to null as it is now read-only. Sending the quantity accidentally will result in an exception.
            variant.InventoryQuantity = null;
            variant.SKU = "TestSKU";                 //To change fulfillment, SKU is required
            variant.InventoryManagement = "Shopify"; //To set inventory, InventoryManagement must be Shopify

            await VariantTest.Service.UpdateAsync(variant.Id.Value, variant);
        }