private decimal CalculatePrice(AthleteStatusType athleteStatusType, DateTime?statusExpirationDate, LicensingModelType licensingModelType) { decimal price; switch (licensingModelType) { case LicensingModelType.TwoDays: price = 2; break; case LicensingModelType.ThirtyDays: price = 4; break; case LicensingModelType.LifeLong: price = 8; break; default: throw new ArgumentOutOfRangeException(); } if (athleteStatusType == AthleteStatusType.Advanced && (statusExpirationDate == null || statusExpirationDate.Value >= DateTime.UtcNow)) { price = price * 0.75m; } return(price); }
private AthleteStatus(AthleteStatusType type, ExpirationDate expirationDate) { Type = type; _expirationDate = expirationDate ?? throw new ArgumentNullException(nameof(expirationDate)); }