namespace LegacyUnitTesting.Models
{
    public class ShippingCostCalculator
    {
        public decimal CalcShipping(IProduct prod, int qty, ShippingUrgency urg, ShippingMethod meth, decimal salesTax)
        {
            ShippingMethodFactory smf = new ShippingMethodFactory();
            IShippingStrategy sStrat = smf.GetShippingMethod(meth);
            decimal shipCost = CalcShipCost(prod, qty, urg, sStrat, salesTax);
            return shipCost;
        }

        private decimal CalcShipCost(IProduct prod, int qty, ShippingUrgency urg, IShippingStrategy sStrat, decimal salesTax)
        {
            decimal extraCharges = 0;
            bool areExtraCharges = false;
            decimal shippingCost = sStrat.CalcMethodCost(prod, qty, urg, salesTax);

            //code that I realize is independent of how we ship the product
            if (areExtraCharges)
            {
                shippingCost += extraCharges;
            }
            //…lots more of that code…

            return shippingCost;
        }
    }
}