Randomly generate names of contacts, password, taxid, ... Useful for testing and demonstration.
Generate contact information randomly.
var contact = ContactGenerator.Instance.GenerateContact();
var sortName = contact.SortName;
var longName = contact.LongName;
var givenName = contact.GivenName;
var familyName = contact.FamilyName;
var email = contact.Email;
var telephoneNumber = contact.TelephoneNumber;
It allows to generate only one value of the contact.
var name = ContactGenerator.Instance.GenerateName();
var name = ContactGenerator.Instance.GenerateName();
Generates a string of characters.
var textString = GenericGenerator.Instance.GenerateString();
Generates a string of characters of a certain length.
var textString = GenericGenerator.Instance.GenerateString(3, 20);
Random password generation.
var password = PasswordGenerator.Instance.GeneratePassword();
Generation of passwords randomly, of a certain length.
var password = PasswordGenerator.Instance.GeneratePassword(leng);
Generation of passwords randomly, with a character set determizing
var password = PasswordGenerator.Instance.GeneratePassword("BCDFGHJKLMNPQRSTUWXYZ");
Has extensions for xunit.
Generación de contactos de forma aleatorio para una prueba unitaria.
[Theory]
[GenerateContactInlineData(DataNumber = 3)]
public void ContactGeneratorExtenderContactTest(ContactTest contact)
{
...
}
Randomly generating password for a unit test.
[Theory]
[InlineData("ddefff")]
[MemberData(nameof(PasswordsMatrixData))]
[GeneratePasswordInlineData(DataNumber = 3)]
public void PasswordGenerator03(string password)
{
...
}
NuGet Package | Latest Versions |
---|---|
Nivaes.DataTestGenerator Randomly generate |
|
Nivaes.DataTestGenerator.XUnit Integration with xunit |