using System; using System.Collections.Generic; using System.Linq; using BoundaryLab.Domain; namespace BoundaryLab.Application; public interface IRateSource { int GetRate(); } public sealed class QuoteService(IRateSource rates) { public int Total(int units) { if (!UnitRule.Valid(units)) throw new ArgumentOutOfRangeException(nameof(units)); return checked(units * rates.GetRate()); } }