public void remove_two_invalid_methods() { // remove two offending ship methods var method1 = new HSShipMethod { EstimatedTransitDays = 1, Cost = 5 }; var method2 = new HSShipMethod { EstimatedTransitDays = 2, Cost = 10 }; var method3 = new HSShipMethod { EstimatedTransitDays = 3, Cost = 15 }; var estimates = BuildEstimates(new[] { method1, method2, method3 }); var result = CheckoutIntegrationCommand.FilterSlowerRatesWithHighCost(estimates); var methods = result[0].ShipMethods; Assert.AreEqual(1, methods.Count); Assert.AreEqual(5, methods[0].Cost); }
public void dont_filter_valid_rates() { // preserve order, rates are already correct var method1 = new HSShipMethod { EstimatedTransitDays = 1, Cost = 25 }; var method2 = new HSShipMethod { EstimatedTransitDays = 2, Cost = 15 }; var method3 = new HSShipMethod { EstimatedTransitDays = 3, Cost = 5 }; var estimates = BuildEstimates(new[] { method1, method2, method3 }); var result = CheckoutIntegrationCommand.FilterSlowerRatesWithHighCost(estimates); var methods = result[0].ShipMethods; Assert.AreEqual(3, methods.Count); Assert.AreEqual(25, methods[0].Cost); Assert.AreEqual(15, methods[1].Cost); Assert.AreEqual(5, methods[2].Cost); }
public void handle_methods_with_same_rates() { // handle two estimates with same rates // we do not want to filter out a slower estimate with the same rate var method1 = new HSShipMethod { EstimatedTransitDays = 1, Cost = 15 }; var method2 = new HSShipMethod { EstimatedTransitDays = 2, Cost = 15 }; var method3 = new HSShipMethod { EstimatedTransitDays = 3, Cost = 5 }; var estimates = BuildEstimates(new[] { method1, method2, method3 }); var result = CheckoutIntegrationCommand.FilterSlowerRatesWithHighCost(estimates); var methods = result[0].ShipMethods; Assert.AreEqual(3, methods.Count); Assert.AreEqual(15, methods[0].Cost); Assert.AreEqual(1, methods[0].EstimatedTransitDays); Assert.AreEqual(5, methods[2].Cost); Assert.AreEqual(3, methods[2].EstimatedTransitDays); }
public void handle_free_shipping() { // handle free shipping var method1 = new HSShipMethod { EstimatedTransitDays = 1, Cost = 15 }; var method2 = new HSShipMethod { EstimatedTransitDays = 2, Cost = 0 }; var method3 = new HSShipMethod { EstimatedTransitDays = 3, Cost = 5 }; var estimates = BuildEstimates(new[] { method1, method2, method3 }); var result = CheckoutIntegrationCommand.FilterSlowerRatesWithHighCost(estimates); var methods = result[0].ShipMethods; Assert.AreEqual(2, methods.Count); Assert.AreEqual(15, methods[0].Cost); Assert.AreEqual(0, methods[1].Cost); }
public void handle_mixed_order_by_transit_days() { // remove two offending ship methods, transit days ordered backwards var method1 = new HSShipMethod { EstimatedTransitDays = 3, Cost = 15 }; var method2 = new HSShipMethod { EstimatedTransitDays = 2, Cost = 10 }; var method3 = new HSShipMethod { EstimatedTransitDays = 1, Cost = 5 }; var estimates = BuildEstimates(new[] { method1, method2, method3 }); var result = CheckoutIntegrationCommand.FilterSlowerRatesWithHighCost(estimates); var methods = result[0].ShipMethods; Assert.AreEqual(1, methods.Count); Assert.AreEqual(5, methods[0].Cost); }
private IList <HSShipEstimate> ApplyFlatRateShipping(HSOrderWorksheet worksheet, List <HSShipEstimate> estimates, string medlineSupplierID, string laliciousSupplierID) { return(CheckoutIntegrationCommand.ApplyFlatRateShipping(worksheet, estimates)); }