Esempio n. 1
0
        public async Task GetCartAsync_CartWith1Product_OperationSuccess()
        {
            var preparedCart = await _openApiProxyClient.PushToCartAsync(new PushToCartRequest
            {
                ProductId = "fincpangfirrnoir",
                OfferId   = "fincpangfirrnoir",
                Quantity  = 1,
                SellerId  = 0,
                SizeId    = null
            });

            var response = await _openApiProxyClient.GetCartAsync(new GetCartRequest
            {
                CartGuid = preparedCart.CartGuid
            });

            Assert.IsNotNull(response);
            Assert.IsTrue(response.OperationSuccess);
            Assert.IsTrue(string.IsNullOrEmpty(response.ErrorMessage));
            Assert.AreEqual(preparedCart.CartGuid, response.CartGuid);
            Assert.AreEqual(preparedCart.CheckoutUrl, response.CheckoutUrl);
            Assert.AreEqual(1, response.ProductCount);
            Assert.AreEqual(1, response.TotalQuantity);
            Assert.IsTrue(response.TotalPrice > 0);
            Assert.AreNotEqual(response.CreationDate, DateTime.MinValue);
            Assert.AreNotEqual(response.UpdateDate, DateTime.MinValue);
        }
 public async Task GetCart_ApiKeyMissing_MissingApiKeyExceptionRaised()
 {
     var response = await _openApiProxyClient.GetCartAsync(new GetCartRequest
     {
         CartGuid = Guid.NewGuid()
     });
 }