/// <summary>
 /// Constructor
 /// </summary>
 /// <param name="merchelloContext"></param>
 public CatalogFixedRateShippingApiController(MerchelloContext merchelloContext)
     : base(merchelloContext)
 {
     _shipCountryService = ((ServiceContext) MerchelloContext.Services).ShipCountryService;
     _fixedRateShippingGatewayProvider = (FixedRateShippingGatewayProvider)MerchelloContext.Gateways.Shipping.GetProviderByKey(Constants.ProviderKeys.Shipping.FixedRateShippingProviderKey);
     _shippingContext = MerchelloContext.Gateways.Shipping;
 }
예제 #2
0
        public override void FixtureSetup()
        {
            base.FixtureSetup();

            var warehouseService = PreTestDataWorker.WarehouseService;
            _warehouse = warehouseService.GetDefaultWarehouse();

            _warehouseCatalog = _warehouse.DefaultCatalog();

            var key = Constants.ProviderKeys.Shipping.FixedRateShippingProviderKey;
            _fixedRateProvider = (FixedRateShippingGatewayProvider)MerchelloContext.Gateways.Shipping.ResolveByKey(key);

            var shipCountryService = PreTestDataWorker.ShipCountryService;
            _shipCountry = shipCountryService.GetShipCountryByCountryCode(_warehouseCatalog.Key, "US");
        }
 /// <summary>
 /// This is a helper contructor for unit testing
 /// </summary>
 internal CatalogFixedRateShippingApiController(MerchelloContext merchelloContext, UmbracoContext umbracoContext)
     : base(merchelloContext, umbracoContext)
 {
     _shipCountryService = ((ServiceContext)MerchelloContext.Services).ShipCountryService;
     _fixedRateShippingGatewayProvider = (FixedRateShippingGatewayProvider)MerchelloContext.Gateways.Shipping.CreateInstance(Constants.ProviderKeys.Shipping.FixedRateShippingProviderKey);
 }