public static string BuildTestString(string pattern)
        {
            if (string.IsNullOrWhiteSpace(pattern))
            {
                throw new ArgumentException("Value cannot be null or whitespace.", nameof(pattern));
            }

            var randomizer = new Bogus.Randomizer();

            const int noMatchPercentage = 50;

            if (WeightedMatch(noMatchPercentage))
            {
                return(randomizer.String());
            }

            const int charMatchPercentage = 95;
            var       strBuilder          = new StringBuilder(pattern.Length * 2);

            foreach (var patternCh in pattern)
            {
                if (patternCh == '?')
                {
                    strBuilder.Append(randomizer.AlphaNumeric(1));
                }
                else if (patternCh == '*')
                {
                    strBuilder.Append(randomizer.Words());
                }
                else
                {
                    if (WeightedMatch(charMatchPercentage))
                    {
                        strBuilder.Append(patternCh);
                    }
                }
            }

            var str = strBuilder.ToString();

            return(str);

            bool WeightedMatch(int percentage)
            {
                return(randomizer.Bool(percentage / 100f));
            }
        }