public double GetPrice(MOrder order, MShippingService shippingService) { switch (shippingService) { case MShippingService.Posta: return(ComputeForPosta(order, shippingService)); case MShippingService.TCE: return(ComputeForTCE(order, shippingService)); case MShippingService.IndiaPost: return(ComputeForIndiaPost(order, shippingService)); default: throw new Exception("Me not know the shipping service, boom boom"); } }
private double ComputeForPosta(MOrder order, MShippingService shippingService) { return(200); }
private double ComputeForTCE(MOrder order, MShippingService shippingService) { return(150); }
private double ComputeForIndiaPost(MOrder order, MShippingService shippingService) { return(50); }