static RandomDataHelper() { ConversationIdProperties.MinNumberOfCodePoints = 64; ConversationIdProperties.MaxNumberOfCodePoints = 255; ConversationIdProperties.UnicodeRanges.Clear(); ConversationIdProperties.UnicodeRanges.Add(new UnicodeRange('A', 'F')); ConversationIdProperties.UnicodeRanges.Add(new UnicodeRange('0', '9')); NameProperties.MinNumberOfCodePoints = 5; NameProperties.MinNumberOfCodePoints = 15; Ranges.ForEach(x => NameProperties.UnicodeRanges.Add(x)); AliasProperties.MinNumberOfCodePoints = 4; AliasProperties.MaxNumberOfCodePoints = 10; AliasProperties.UnicodeRanges.Clear(); AliasProperties.UnicodeRanges.Add(new UnicodeRange(UnicodeChart.Latin)); SubjectProperties.MinNumberOfCodePoints = 10; SubjectProperties.MaxNumberOfCodePoints = 50; Ranges.ForEach(x => SubjectProperties.UnicodeRanges.Add(x)); BodyProperties.MinNumberOfCodePoints = 0; BodyProperties.MaxNumberOfCodePoints = 500; Ranges.ForEach(x => BodyProperties.UnicodeRanges.Add(x)); }
public void Validate() { Ranges.ForEach(r => r.Validate()); ConditionalProperties.ForEach(x => x.Condition.Validate()); if (Ranges.Select(x => x.Name).Distinct().Count() < Ranges.Count) { throw new ValidationException($"{Name}: indices must have different names"); } }