All Projects β†’ stone-payments β†’ StrangerData

stone-payments / StrangerData

Licence: MIT License
πŸ‘½ A .NET database populator for testing purposes

Programming Languages

C#
18002 projects
powershell
5483 projects

Projects that are alternatives of or similar to StrangerData

Avoriaz
πŸ”¬ a Vue.js testing utility library
Stars: ✭ 771 (+3404.55%)
Mutual labels:  testing-tools, test-driven-development
Beanmother
A library for setting up Java objects as test data.
Stars: ✭ 102 (+363.64%)
Mutual labels:  testing-tools, test-driven-development
Gotests
Automatically generate Go test boilerplate from your source code.
Stars: ✭ 3,597 (+16250%)
Mutual labels:  testing-tools, test-driven-development
Awesome Unit Testing Swift
A curated collection of awesome blog articles, books, talks, podcasts, tools/frameworks and examples.
Stars: ✭ 272 (+1136.36%)
Mutual labels:  testing-tools, test-driven-development
eat
Json based scenario testing tool(which can have test for functional and non-functional)
Stars: ✭ 41 (+86.36%)
Mutual labels:  testing-tools, test-driven-development
Mockito
Most popular Mocking framework for unit tests written in Java
Stars: ✭ 12,453 (+56504.55%)
Mutual labels:  testing-tools, test-driven-development
Testcl
when you don't have the balls to test your F5 BIG-IP iRules directly in production
Stars: ✭ 79 (+259.09%)
Mutual labels:  testing-tools, test-driven-development
PixelTest
Fast, modern, simple iOS snapshot testing written purely in Swift.
Stars: ✭ 56 (+154.55%)
Mutual labels:  testing-tools, test-driven-development
Mockito Scala
Mockito for Scala language
Stars: ✭ 231 (+950%)
Mutual labels:  testing-tools, test-driven-development
Junit Dataprovider
A TestNG like dataprovider runner for JUnit with many additional features
Stars: ✭ 226 (+927.27%)
Mutual labels:  testing-tools, test-driven-development
react-native-unit-tests
Example how to test React Native components
Stars: ✭ 79 (+259.09%)
Mutual labels:  testing-tools, test-driven-development
mockcpp
Two C/C++ testing tools, mockcpp and testngpp.
Stars: ✭ 40 (+81.82%)
Mutual labels:  testing-tools, test-driven-development
mountebank-UI
ui for editing mountebank doubles
Stars: ✭ 28 (+27.27%)
Mutual labels:  testing-tools
MockDataGenerator
Generate mock data for POCO
Stars: ✭ 12 (-45.45%)
Mutual labels:  testing-tools
testkube
☸️ Kubernetes-native framework for test definition and execution
Stars: ✭ 172 (+681.82%)
Mutual labels:  testing-tools
cypress-plugin-stripe-elements
A small Cypress plugin that assists you in filling in Stripe Elements inputs
Stars: ✭ 22 (+0%)
Mutual labels:  testing-tools
jdbdt
JDBDT: Java Database Delta Testing
Stars: ✭ 12 (-45.45%)
Mutual labels:  testing-tools
DeepfakeHTTP
DeepfakeHTTP is a web server that uses HTTP dumps as a source for responses.
Stars: ✭ 373 (+1595.45%)
Mutual labels:  testing-tools
showroom
Universal development and automated test environment for web components
Stars: ✭ 89 (+304.55%)
Mutual labels:  testing-tools
op-test
Testing Firmware for OpenPOWER systems
Stars: ✭ 30 (+36.36%)
Mutual labels:  testing-tools

StrangerData - A .NET database populator for testing purposes

Travis

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.

Getting Started

  1. Install StrangerData with NuGet Package Manager:

Install-Package StrangerData

  1. Install your database dialect, example:

Install-Package StrangerData.SqlServer

  1. Configure the required connection strings.

To start generating your test data, create a new DataFactory object:

using StrangerData;
using StrangerData.SqlServer;
...
var dataFactory = new DataFactory<SqlServerDialect>("MyConnectionString");

Usage

Consider the example schema:

Person Table

Column Data Type PK FK
Id INT True False
Name VARCHAR(20) False False
Email 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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].