{"id":20430497,"url":"https://github.com/stone-payments/strangerdata","last_synced_at":"2025-04-12T20:33:32.522Z","repository":{"id":53571380,"uuid":"64158626","full_name":"stone-payments/StrangerData","owner":"stone-payments","description":":alien: A .NET database populator for testing purposes","archived":false,"fork":false,"pushed_at":"2024-07-18T14:44:32.000Z","size":124,"stargazers_count":26,"open_issues_count":11,"forks_count":9,"subscribers_count":36,"default_branch":"master","last_synced_at":"2024-11-11T20:13:26.462Z","etag":null,"topics":["net-database-populator","sec-squad-payments-finance","sec-tribo-finance","test-driven-development","testing-tools"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stone-payments.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"Contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-25T18:32:24.000Z","updated_at":"2024-10-21T20:34:40.000Z","dependencies_parsed_at":"2024-02-08T20:31:39.259Z","dependency_job_id":"22ecfb60-36eb-43d8-94bb-f192be2373a4","html_url":"https://github.com/stone-payments/StrangerData","commit_stats":null,"previous_names":["stone-pagamentos/strangerdata"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stone-payments%2FStrangerData","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stone-payments%2FStrangerData/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stone-payments%2FStrangerData/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stone-payments%2FStrangerData/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stone-payments","download_url":"https://codeload.github.com/stone-payments/StrangerData/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224748606,"owners_count":17363312,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["net-database-populator","sec-squad-payments-finance","sec-tribo-finance","test-driven-development","testing-tools"],"created_at":"2024-11-15T08:07:38.158Z","updated_at":"2024-11-15T08:07:38.711Z","avatar_url":"https://github.com/stone-payments.png","language":"C#","readme":"# StrangerData - A .NET database populator for testing purposes\n\n## Project Description ##\nStrangerData is a tool designed to automatically fills your database with random data to make your unit/integration tests faster.  \nThe generator will auto maps all foreign keys and generates records to related tables.\n\n## Getting Started ##\n1. Install StrangerData with NuGet Package Manager:\n\u003e Install-Package StrangerData\n\n2. Install your database dialect, example:\n\u003e Install-Package StrangerData.SqlServer\n\n3. Configure the required connection strings.\n\nTo start generating your test data, create a new DataFactory object:\n```csharp\nusing StrangerData;\nusing StrangerData.SqlServer;\n...\nvar dataFactory = new DataFactory\u003cSqlServerDialect\u003e(\"MyConnectionString\");\n```\n\n## Usage ##\n\nConsider the example schema:\n\n#### Person Table\n\n\n| Column | Data Type | PK | FK |\n| --- | --- | --- | --- |\n| Id | INT | True | False |\n| Name | VARCHAR(20) | False | False |\n| Email | VARCHAR(50) | False | False |\n| Age | INT | False | False |\n| TeamId | INT | False | Team(Id) |\n\n\n#### Team Table\n\n\n| Column | Data Type | PK | FK |\n| --- | --- | --- | --- |\n| Id | INT | True | False |\n| Name | VARCHAR(20) | False | False |\n\n\n### 1. Creates a single record:\n```csharp\n...\nIDicionary\u003cstring, object\u003e record = dataFactory.CreateOne(\"dbo.Person\");\n```\nThe method will creates an record in the group table, and associates it to the created user. The dictionary will contains:\n```json\n{\n  \"Id\": \"Generated User's Id\",\n  \"Name\": \"Random string\",\n  \"Email\": \"Random string\",\n  \"Age\": \"Random integer number\",\n  \"TeamId\": \"Id from generated group record\"\n}\n```\nSo you can specify your custom values. Do following:\n```csharp\nUser user = dataFactory.CreateOne(\"dbo.Person\", t =\u003e {\n    t.WithValue(\"Name\", \"Will Byers\");\n});\n```\n\nThe dictionary will contains:\n```json\n{\n  \"Id\": \"Generated User's Id\",\n  \"Name\": \"Will Byers\",\n  \"Email\": \"Random string\",\n  \"Age\": \"Random integer number\",\n  \"TeamId\": \"Id from generated group record\"\n}\n```\n\n### 2. Delete generated records:\nTo delete all generated records, just run:\n```csharp\n...\ndataFactory.TearDown();\n...\n```\n\nWe 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.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstone-payments%2Fstrangerdata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstone-payments%2Fstrangerdata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstone-payments%2Fstrangerdata/lists"}