StrangerData 101.0.0
dotnet add package StrangerData --version 101.0.0
NuGet\Install-Package StrangerData -Version 101.0.0
<PackageReference Include="StrangerData" Version="101.0.0" />
paket add StrangerData --version 101.0.0
#r "nuget: StrangerData, 101.0.0"
// Install StrangerData as a Cake Addin #addin nuget:?package=StrangerData&version=101.0.0 // Install StrangerData as a Cake Tool #tool nuget:?package=StrangerData&version=101.0.0
StrangerData - A .NET database populator for testing purposes
Project Description
StrangerData is a tool designed to automatically fills your database with random data to make your unit/integration tests faster.
The generator will auto maps all foreign keys and generates records to related tables.
Usage
Consider the example schema:
Person Table
Column | Data Type | PK | FK |
---|---|---|---|
Id | INT | True | False |
Name | VARCHAR(20) | False | False |
VARCHAR(50) | False | False | |
Age | INT | False | False |
TeamId | INT | False | Team(Id) |
Team Table
Column | Data Type | PK | FK |
---|---|---|---|
Id | INT | True | False |
Name | VARCHAR(20) | False | False |
1. Creates a single record:
...
IDicionary<string, object> record = dataFactory.CreateOne("dbo.Person");
The method will creates an record in the group table, and associates it to the created user. The dictionary will contains:
{
"Id": "Generated User's Id",
"Name": "Random string",
"Email": "Random string",
"Age": "Random integer number",
"TeamId": "Id from generated group record"
}
So you can specify your custom values. Do following:
User user = dataFactory.CreateOne("dbo.Person", t => {
t.WithValue("Name", "Will Byers");
});
The dictionary will contains:
{
"Id": "Generated User's Id",
"Name": "Will Byers",
"Email": "Random string",
"Age": "Random integer number",
"TeamId": "Id from generated group record"
}
2. Delete generated records:
To delete all generated records, just run:
...
dataFactory.TearDown();
...
We suggest to use the TearDown() method inside yor Finally scope. This way it will run even if you code crashes on running, avoiding to have dirty data on your database.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net452 is compatible. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.5.2
- No dependencies.
-
.NETStandard 2.0
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.Configuration.FileExtensions (>= 8.0.0)
- Microsoft.Extensions.Configuration.Json (>= 8.0.0)
-
net8.0
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.Configuration.FileExtensions (>= 8.0.0)
- Microsoft.Extensions.Configuration.Json (>= 8.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on StrangerData:
Package | Downloads |
---|---|
StrangerData.SqlServer
MS SQL Server Dialect for StrangerData data generator. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
101.0.0 | 3,351 | 2/8/2024 |
100.0.1 | 26,999 | 3/23/2021 |
100.0.0 | 778 | 3/19/2021 |
99.99.99 | 22,016 | 10/31/2017 |
1.0.64 | 3,162 | 5/27/2017 |
1.0.63 | 1,295 | 3/8/2017 |
1.0.62 | 1,344 | 2/17/2017 |
1.0.45 | 1,007 | 1/9/2017 |
1.0.42 | 970 | 1/9/2017 |
1.0.39 | 1,300 | 10/13/2016 |
1.0.37 | 2,049 | 10/13/2016 |
1.0.35 | 1,232 | 10/7/2016 |
0.0.5 | 1,319 | 9/20/2016 |
0.0.4 | 1,302 | 8/25/2016 |
0.0.3 | 1,919 | 8/1/2016 |
0.0.2 | 1,809 | 7/26/2016 |