public static void IfTooLong( [CanBeNull] string value, int maxLength, [NotNull][System.Diagnostics.CodeAnalysis.NotNull] string name) { Fail.RequiresArgumentName(name); if (value == null) { return; } int currentLength = value.Length; if (currentLength > maxLength) { throw Fail.Because(Violation.WhenTooLong(name, currentLength, maxLength)); } }