private static string RandomizeString(UIComponentMetadata metadata) { var attribute = metadata.Get <RandomizeStringSettingsAttribute>(AttributeLevels.Declared) ?? new RandomizeStringSettingsAttribute(); string format = NormalizeStringFormat(attribute.Format); return(Randomizer.GetString(format, attribute.NumberOfCharacters)); }
private static string RandomizeString(UIComponentMetadata metadata) { if (!TryRandomizeOneOfIncluded(metadata, out string value)) { var attribute = metadata.Get <RandomizeStringSettingsAttribute>() ?? new RandomizeStringSettingsAttribute(); value = Randomizer.GetString(attribute.Format, attribute.NumberOfCharacters); } return(value); }
private static string RandomizeString(UIComponentMetadata metadata) { string value; if (!TryRandomizeOneOfIncluded(metadata, out value)) { var attribute = metadata.Get <RandomizeStringSettingsAttribute>(x => x.At(AttributeLevels.Declared)) ?? new RandomizeStringSettingsAttribute(); string format = NormalizeStringFormat(attribute.Format); value = Randomizer.GetString(format, attribute.NumberOfCharacters); } return(value); }