/// <summary>
        /// Creates an instance of a <see cref="FixedRateShippingGatewayMethod"/>
        /// </summary>
        /// <param name="quoteType">
        /// The quote Type.
        /// </param>
        /// <param name="shipCountry">
        /// The ship Country.
        /// </param>
        /// <param name="name">
        /// The name.
        /// </param>
        /// <remarks>
        /// 
        /// This method is really specific to the RateTableShippingGateway due to the odd fact that additional shipmethods can be created 
        /// rather than defined up front.  
        /// 
        /// </remarks>
        /// <returns>
        /// The <see cref="IShippingGatewayMethod"/> created
        /// </returns>
        public IShippingGatewayMethod CreateShipMethod(FixedRateShippingGatewayMethod.QuoteType quoteType, IShipCountry shipCountry, string name)
        {
            var resource = quoteType == FixedRateShippingGatewayMethod.QuoteType.VaryByWeight
                ? AvailableResources.First(x => x.ServiceCode == "VBW")
                : AvailableResources.First(x => x.ServiceCode == "VBP");

            return CreateShippingGatewayMethod(resource, shipCountry, name);
        }
示例#2
0
        public void Init()
        {
            _fixedRateProvider.DeleteAllActiveShipMethods(_shipCountry);

            _gwshipMethod = (FixedRateShippingGatewayMethod)_fixedRateProvider.CreateShipMethod(FixedRateShippingGatewayMethod.QuoteType.VaryByWeight, _shipCountry, "Ground (VBW)");
            _gwshipMethod.RateTable.AddRow(0, 10, 5);
            _gwshipMethod.RateTable.AddRow(10, 15, 10);
            _gwshipMethod.RateTable.AddRow(15, 25, 25);
            _gwshipMethod.RateTable.AddRow(25, 10000, 100);

            _fixedRateProvider.SaveShippingGatewayMethod(_gwshipMethod);

            if (_gwshipMethod.ShipMethod.Provinces.Any(x => x.AllowShipping == false))
            {
                Assert.Ignore("One of the Provinces was null");
            }
        }