Exemple #1
0
        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));
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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);
        }