コード例 #1
0
        public async Task PushToCartAsync_AddItemMkp_OperationSuccess()
        {
            var productResponse = await _openApiProxyClient.GetProductAsync(new GetProductRequest
            {
                ProductIdList = new List <string> {
                    "nikd52001855vr2"
                },
                Scope = new GetProductRequestScope
                {
                    Ean    = true,
                    Offers = true
                }
            });

            Assert.IsTrue(productResponse.OperationSuccess);
            Assert.IsTrue(productResponse.Products != null && productResponse.Products.Any());

            var product = productResponse.Products.First();
            var offer   = product.Offers.First(o => o.Seller.Id > 0);

            var response = await _openApiProxyClient.PushToCartAsync(null, product, offer);

            Assert.IsNotNull(response);
            Assert.IsTrue(response.OperationSuccess);
            Assert.AreEqual("NoError", response.ErrorType);
            Assert.IsTrue(string.IsNullOrEmpty(response.ErrorMessage));
            Assert.IsNotNull(response.CartGuid);
            Assert.IsNotNull(response.CheckoutUrl);
        }
コード例 #2
0
 public async Task GetProduct_ApiKeyMissing_MissingApiKeyExceptionRaised()
 {
     var response = await _openApiProxyClient.GetProductAsync(new GetProductRequest
     {
         ProductIdList = new List <string> {
             "fincpangfirrnoir"
         },
         Scope = new GetProductRequestScope
         {
             Ean = true
         }
     });
 }
コード例 #3
0
        public async Task GetProductAsync_1ProductByProductId_OperationSuccess()
        {
            var response = await _openApiProxyClient.GetProductAsync(new GetProductRequest
            {
                ProductIdList = new List <string> {
                    "fincpangfirrnoir"
                },
                Scope = new GetProductRequestScope
                {
                    Ean = true
                }
            });

            Assert.IsNotNull(response);
            Assert.IsTrue(response.OperationSuccess);
            Assert.IsTrue(string.IsNullOrEmpty(response.ErrorMessage));
            Assert.AreEqual(1, response.Products.Count);

            var product = response.Products[0];

            Assert.AreEqual("fincpangfirrnoir".ToUpper(), product.Id);
            Assert.IsFalse(string.IsNullOrEmpty(product.Ean));
        }