public void Shoul_Get_A_Customer_By_Id() { var repository = new RepositoryService(MagentoConnection.Instance, new FakeCacheManager()); var customer = repository.GetCustomerById(40); Assert.IsNotNull(customer); }
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"); }
public void Should_Associate_Customer_To_Cart() { var key = ConfigurationHelper.CacheKeyNames; //var repository = new RepositoryService(MagentoConnection.Instance, FakeCacheManager); //var cartId = repository.CreateCart(); var repository = new RepositoryService(MagentoConnection.Instance, FakeCacheManager); var customer = repository.GetCustomerById(33); customer.mode = "register"; var result = repository.AssociateCustomerToCart(testCartId, customer); Assert.IsTrue(result, "Non è stato possibile associare un carrello valido ad un utente esistente"); }