public void Init()
        {
            _destination = new Address()
            {
                Name        = "Mindfly Web Design Studio",
                Address1    = "114 W. Magnolia St.  Suite 504",
                Locality    = "Bellingham",
                Region      = "WA",
                PostalCode  = "98225",
                CountryCode = "US"
            };

            PreTestDataWorker.DeleteAllItemCaches();
            PreTestDataWorker.DeleteAllInvoices();
            _customer = PreTestDataWorker.MakeExistingAnonymousCustomer();
            _basket   = Basket.GetBasket(MerchelloContext, _customer);

            for (var i = 0; i < ProductCount; i++)
            {
                _basket.AddItem(PreTestDataWorker.MakeExistingProduct(true, WeightPerProduct, PricePerProduct));
            }

            Basket.Save(MerchelloContext, _basket);

            _shipCountry = ShipCountryService.GetShipCountryByCountryCode(Catalog.Key, "US");
        }
Пример #2
0
        public void Init()
        {
            PreTestDataWorker.DeleteAllItemCaches();

            _customer = PreTestDataWorker.MakeExistingAnonymousCustomer();
            _basket   = Basket.GetBasket(MerchelloContext.Current, _customer);
        }
Пример #3
0
        public void Init()
        {
            PreTestDataWorker.DeleteAllProducts();
            PreTestDataWorker.DeleteAllItemCaches();


            _customer = PreTestDataWorker.MakeExistingAnonymousCustomer();
            _basket   = Basket.GetBasket(MerchelloContext.Current, _customer);

            for (var i = 0; i < ProductCount; i++)
            {
                _basket.AddItem(PreTestDataWorker.MakeExistingProduct());
            }
            _basket.AddItem(PreTestDataWorker.MakeExistingProduct(false));

            Basket.Save(MerchelloContext.Current, _basket);
        }
Пример #4
0
        public virtual void Init()
        {
            Customer = PreTestDataWorker.MakeExistingAnonymousCustomer();
            Basket   = Web.Workflow.Basket.GetBasket(MerchelloContext.Current, Customer);

            var odd = true;

            for (var i = 0; i < ProductCount; i++)
            {
                var product = PreTestDataWorker.MakeExistingProduct(true, WeightPerProduct, PricePerProduct);
                product.AddToCatalogInventory(PreTestDataWorker.WarehouseCatalog);
                product.CatalogInventories.First().Count = 10;
                product.TrackInventory = true;
                PreTestDataWorker.ProductService.Save(product);
                Basket.AddItem(product, 2);

                odd = !odd;
            }

            BillingAddress = new Address()
            {
                Name        = "Out there",
                Address1    = "some street",
                Locality    = "some city",
                Region      = "ST",
                PostalCode  = "98225",
                CountryCode = "US"
            };

            var origin = new Address()
            {
                Name        = "Somewhere",
                Address1    = "origin street",
                Locality    = "origin city",
                Region      = "ST",
                PostalCode  = "98225",
                CountryCode = "US"
            };



            PreTestDataWorker.DeleteAllItemCaches();
            PreTestDataWorker.DeleteAllInvoices();


            Customer.ExtendedData.AddAddress(BillingAddress, AddressType.Billing);
            ItemCache = new Core.Models.ItemCache(Customer.Key, ItemCacheType.Checkout);

            PreTestDataWorker.ItemCacheService.Save(ItemCache);

            foreach (var item in Basket.Items)
            {
                ItemCache.AddItem(item.AsLineItemOf <ItemCacheLineItem>());
            }


            // setup the checkout
            SalePreparationMock = new SalePreparationMock(MerchelloContext.Current, ItemCache, Customer);

            // add the shipment rate quote
            var shipment      = Basket.PackageBasket(MerchelloContext.Current, BillingAddress).First();
            var shipRateQuote = shipment.ShipmentRateQuotes(MerchelloContext.Current).FirstOrDefault();

            //_checkoutMock.ItemCache.Items.Add(shipRateQuote.AsLineItemOf<InvoiceLineItem>());
            SalePreparationMock.SaveShipmentRateQuote(shipRateQuote);
        }
 public void Initialize()
 {
     PreTestDataWorker.DeleteAllItemCaches();
     _itemCacheService = PreTestDataWorker.ItemCacheService;
     _anonymous        = PreTestDataWorker.MakeExistingAnonymousCustomer();
 }