Nivaes.DataTestGenerator
3.1.1.6
dotnet add package Nivaes.DataTestGenerator --version 3.1.1.6
NuGet\Install-Package Nivaes.DataTestGenerator -Version 3.1.1.6
<PackageReference Include="Nivaes.DataTestGenerator" Version="3.1.1.6" />
<PackageVersion Include="Nivaes.DataTestGenerator" Version="3.1.1.6" />
<PackageReference Include="Nivaes.DataTestGenerator" />
paket add Nivaes.DataTestGenerator --version 3.1.1.6
#r "nuget: Nivaes.DataTestGenerator, 3.1.1.6"
#:package Nivaes.DataTestGenerator@3.1.1.6
#addin nuget:?package=Nivaes.DataTestGenerator&version=3.1.1.6
#tool nuget:?package=Nivaes.DataTestGenerator&version=3.1.1.6
Nivaes.DataTestGenerator
Biblioteca .NET para generar datos aleatorios de prueba y demostración: contactos, contraseñas, identificadores fiscales españoles y valores básicos.
Los valores son datos de prueba. No uses las contraseñas generadas como credenciales reales ni los identificadores generados como documentos válidos o asignados a una persona o entidad.
Requisitos
- .NET 8.0 o posterior.
Instalación
Instala el paquete principal:
dotnet add package Nivaes.DataTestGenerator
Uso
Los ejemplos usan el espacio de nombres Nivaes.DataTestGenerator.
Contactos
using Nivaes.DataTestGenerator;
ContactTest contact = ContactGenerator.GenerateContact();
Console.WriteLine(contact.LongName);
Console.WriteLine(contact.Email);
Console.WriteLine(contact.TelephoneNumber);
string name = ContactGenerator.GenerateName();
ContactTest también contiene SortName, GivenName y FamilyName. Para generar un contacto con un correo más distintivo, usa ContactGenerator.GenerateExtenderContact().
Cadenas, enteros y números decimales
string text = GenericGenerator.GenerateString();
string sizedText = GenericGenerator.GenerateString(20);
string rangedText = GenericGenerator.GenerateString(3, 20); // longitud entre 3 y 19
int anyInt = GenericGenerator.GenerateInt();
int rangedInt = GenericGenerator.GenerateInt(1, 100); // entre 1 y 99
double rangedDouble = GenericGenerator.GenerateDouble(0, 1);
Contraseñas
PasswordGenerator se usa mediante su propiedad Instance:
PasswordGenerator generator = PasswordGenerator.Instance;
string password = generator.GeneratePassword();
string fixedLength = generator.GeneratePassword(16);
string customCharacters = generator.GeneratePassword(12, "ABCDEFGHJKLMNPQRSTUVWXYZ23456789");
Si no se indica una longitud, se genera una longitud aleatoria. El conjunto de caracteres predeterminado incluye varios grupos; al proporcionar una cadena como conjunto personalizado, los caracteres se eligen de esa cadena.
Identificadores fiscales españoles
string nif = TaxIdGenerator.GenerateNif();
string nie = TaxIdGenerator.GenerateNie();
string cif = TaxIdGenerator.GenerateCif();
string nifNie = TaxIdGenerator.GenerateNifNie();
string taxId = TaxIdGenerator.GenerateTaxId();
Estos métodos sirven para generar valores de prueba con formato y dígitos de control calculados; no garantizan que el identificador corresponda a una persona o entidad real.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. net11.0 is compatible. |
-
net10.0
- No dependencies.
-
net11.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Nivaes.DataTestGenerator:
| Package | Downloads |
|---|---|
|
Nivaes.DataTestGenerator.XUnit
Tool for generating data testing with xunit extensions. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.1.1.6 | 99 | 11/21/2026 |
| 3.1.0.4 | 286 | 8/22/2026 |
| 3.1.0.2 | 151 | 8/5/2026 |
| 3.1.0.1 | 139 | 8/5/2026 |
| 3.0.3 | 567 | 1/1/2026 |
| 2.11.20 | 448 | 11/12/2025 |
| 2.10.13 | 1,118 | 11/17/2024 |
| 2.9.12 | 1,254 | 3/30/2024 |
| 2.8.11 | 476 | 2/10/2024 |
| 2.7.10 | 2,134 | 11/11/2021 |
| 2.7.8 | 1,136 | 1/9/2021 |
| 2.6.4 | 687 | 11/17/2020 |
| 2.6.3 | 1,248 | 8/1/2020 |
| 2.5.7 | 955 | 6/12/2020 |
| 2.5.5 | 1,003 | 2/19/2020 |
| 2.5.4 | 946 | 2/9/2020 |
| 2.5.3 | 1,043 | 1/28/2020 |
| 2.4.0 | 759 | 1/28/2020 |
| 2.3.5 | 812 | 1/1/2020 |
| 2.3.3 | 785 | 1/1/2020 |