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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Nivaes.DataTestGenerator" Version="3.1.1.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nivaes.DataTestGenerator" Version="3.1.1.6" />
                    
Directory.Packages.props
<PackageReference Include="Nivaes.DataTestGenerator" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Nivaes.DataTestGenerator --version 3.1.1.6
                    
#r "nuget: Nivaes.DataTestGenerator, 3.1.1.6"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Nivaes.DataTestGenerator@3.1.1.6
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Nivaes.DataTestGenerator&version=3.1.1.6
                    
Install as a Cake Addin
#tool nuget:?package=Nivaes.DataTestGenerator&version=3.1.1.6
                    
Install as a Cake Tool

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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
Loading failed