コード例 #1
0
ファイル: CartTest.cs プロジェクト: giuseppecristella/MaWeb
        public void Should_Create_Cart_In_Magento()
        {
            var customerId = 33;
            var repository = new RepositoryService(MagentoConnection.Instance, FakeCacheManager);
            var cart       = repository.CreateCart();
            var customer   = repository.GetCustomerById(customerId);

            customer.mode = "register";

            var result            = repository.AssociateCustomerToCart(cart, customer);
            var customerAddresses = repository.GetCustomerAddresses(customerId);

            customerAddresses[0].mode = "billing";
            customerAddresses[1].mode = "shipping";

            var areCustomerAddressesAddedToCart = repository.AddCustomerAddressesToCart(cart, customerAddresses);

            var product = GetProductById("538");

            repository.AddProductToCart(cart, product);


            var paymentMethods = repository.GetPaymentMethods(cart);

            var qty = repository.GetProductsByCategoryId("49");
        }