diff --git a/ShippingCosts/Implementations/ShippingCostCalculatorBase.cs b/ShippingCosts/Implementations/ShippingCostCalculatorBase.cs index 3017e99..8cc2b3e 100644 --- a/ShippingCosts/Implementations/ShippingCostCalculatorBase.cs +++ b/ShippingCosts/Implementations/ShippingCostCalculatorBase.cs @@ -20,7 +20,16 @@ public abstract class ShippingCostCalculatorBase(ICountryDistanceProvider countr /// Sum of the longest and shortest side protected static int SumOfLongestAndShortestSides(IMeasuredBox box) { - // TODO - return -1; + int[] sides = [box.Width, box.Height, box.Depth]; + for (int i = 0; i < sides.Length; i++) + { + if (sides[i] <= 0) + { + return 0; + } + } + + Array.Sort(sides); + return sides[0] + sides[2]; } }