Skip to content

Nivaes/Nivaes.DataTestGenerator

Repository files navigation

DataTestGenerator

Randomly generate names of contacts, password, taxid, ... Useful for testing and demonstration.

Content

Contact generator

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();

More documentation

String generation

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);

More documentation

Password generation

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");

XUnit tool

Has extensions for xunit.

Contact generator

Generación de contactos de forma aleatorio para una prueba unitaria.

[Theory]
[GenerateContactInlineData(DataNumber = 3)]
public void ContactGeneratorExtenderContactTest(ContactTest contact)
{
    ...
}

Password generator

Randomly generating password for a unit test.

[Theory]
[InlineData("ddefff")]
[MemberData(nameof(PasswordsMatrixData))]
[GeneratePasswordInlineData(DataNumber = 3)]
public void PasswordGenerator03(string password)
{
    ...
}

Packages

NuGet Package Latest Versions
Nivaes.DataTestGenerator
Randomly generate
latest stable version
Nivaes.DataTestGenerator.XUnit
Integration with xunit
latest prerelease version

Integration

CI codecov

Build Release

Publish Release