Implemented ShippingCostCalculatorBase.cs

This commit is contained in:
MarcUs7i 2025-05-09 10:33:29 +02:00
parent ed9908d011
commit d2424e2c67

View file

@ -20,7 +20,16 @@ public abstract class ShippingCostCalculatorBase(ICountryDistanceProvider countr
/// <returns>Sum of the longest and shortest side</returns>
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];
}
}