/// <summary> /// Get a value from the data source. /// </summary> /// <param name="generateContext">The generate context.</param> /// <returns> /// A new value from the data source. /// </returns> public override object NextValue(IGenerateContext generateContext) { int i = RandomGenerator.Current.Next(0, _domains.Length); string name = PasswordSource.Generate(8); string domain = string.IsNullOrEmpty(_domain) ? _domains[i] : _domain.Trim(); return(string.Format("{0}{1}@{2}", name, _index++, domain)); }
public void NextValue() { var source = new PasswordSource(); for (int i = 0; i < 10; i++) { var nextValue = source.NextValue(null); _output.WriteLine($"Value {i}: {nextValue}"); } }