{"id":13664421,"url":"https://github.com/CreateAndFake/CreateAndFake","last_synced_at":"2025-04-26T01:31:27.973Z","repository":{"id":48110128,"uuid":"123838470","full_name":"CreateAndFake/CreateAndFake","owner":"CreateAndFake","description":"A C# class library that handles mocking, test data generation, and validation.","archived":false,"fork":false,"pushed_at":"2025-03-05T07:20:23.000Z","size":1650,"stargazers_count":11,"open_issues_count":6,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-05T07:25:16.045Z","etag":null,"topics":["clone","cloning","create","data","equality","fake","mock","mocking","mocks","random","randomization","stubs","testing","tests"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CreateAndFake.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-04T23:18:09.000Z","updated_at":"2024-11-02T01:28:58.000Z","dependencies_parsed_at":"2024-08-21T04:46:58.292Z","dependency_job_id":"f27ccb32-43f2-4e34-a781-347745fa94d5","html_url":"https://github.com/CreateAndFake/CreateAndFake","commit_stats":null,"previous_names":[],"tags_count":52,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CreateAndFake%2FCreateAndFake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CreateAndFake%2FCreateAndFake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CreateAndFake%2FCreateAndFake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CreateAndFake%2FCreateAndFake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CreateAndFake","download_url":"https://codeload.github.com/CreateAndFake/CreateAndFake/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250919592,"owners_count":21507969,"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":["clone","cloning","create","data","equality","fake","mock","mocking","mocks","random","randomization","stubs","testing","tests"],"created_at":"2024-08-02T05:02:55.923Z","updated_at":"2025-04-26T01:31:27.602Z","avatar_url":"https://github.com/CreateAndFake.png","language":"C#","funding_links":[],"categories":["C\\#"],"sub_categories":[],"readme":"# Create \u0026 Fake\n\n[![NuGet](https://img.shields.io/nuget/v/CreateAndFake)](https://www.nuget.org/packages/CreateAndFake) [![Build](https://github.com/CreateAndFake/CreateAndFake/workflows/Integration/badge.svg)](../../actions?query=workflow%3AIntegration) [![CodeCov Coverage](https://codecov.io/gh/CreateAndFake/CreateAndFake/branch/master/graph/badge.svg)](https://codecov.io/gh/CreateAndFake/CreateAndFake/branch/master) [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](code_of_conduct.md)\n\nA C# class library that handles mocking, test data generation, and validation. Designed to handle the bulk of test setup quickly and easily so that developers can focus on the behavior to test, making tests easier to develop and maintain:\n\n```c#\n// xUnit attributes used to automatically create the parameters.\n[Theory, RandomData]\ninternal static void TestGetMovieDirectors(\n    [Fake] IStorage db, Endpoint api, [Size(2)] Details[] movies)\n{\n    // Setup fake behavior using randomized movie data (times optional).\n    db.Find(movies[0].Name).SetupReturn(movies, Times.Once);\n\n    // Call code and test for expected result (api is auto-injected with db fake).\n    api.GetDirectors(movies[0].Name, movies[0].Year).Assert().Is(movies[0].Directors);\n\n    // Optionally check all behavior called as expected.\n    db.VerifyAllCalls();\n}\n```\n\nBy default, all behavior works not by reference but by value even for complex objects. Using the extension methods and attributes are optional as all functionality are present in customizable tools:\n\n```C#\n[Fact]\ninternal static void TestChangingZipCodeUpdatesAddress()\n{\n    // Randomizer uses readable values for some properties like 'FirstName'.\n    User details = Tools.Randomizer.Create\u003cUser\u003e();\n\n    // Duplicator creates deep clones. \n    User copy = Tools.Duplicator.Copy(details);\n\n    // Mutator can randomly modify objects too.\n    details.ZipCode = Tools.Mutator.Variant(details.ZipCode);\n\n    // Asserter performs checks based upon value.\n    Tools.Asserter.IsNot(copy.MailingAddress, details.MailingAddress);\n}\n```\n\nA key benefit of the library is in how the tools are logically integrated with each other. For example, the `Randomizer` will use stubs for interfaces that have no known implementations in the code. Or the mocks created by the `Faker` utilize value equality in matching arguments.\n\n* `Asserter` - Handles common test scenarios.\n* `Faker` - Creates mocks and stubs.\n* `Randomizer` - Creates random instances of any type.\n* `Duplicator` - Creates deep clones of objects.\n* `Mutator` - Mutates objects or creates variants.\n* `Valuer` - Compares objects by value.\n* `Tester` - Automates common tests.\n\nVisit the [documentation site](https://createandfake.github.io/CreateAndFake/) for more information and how to get started.\n\n## Installation\n\n* Install using:\n\n```\ndotnet add package CreateAndFake\n```\n\n* Use in a class by adding:\n\n```\nusing CreateAndFake;\nusing CreateAndFake.Fluent;\n```\n\n## Documentation\n\nThe documentation site is located here: https://createandfake.github.io/CreateAndFake/\n\nThe raw files can be viewed from the doc folder or built into a local site using Jekyll.\n\n## Contributing\n\nIf you're looking to contribute, thanks for your interest. Feel free to submit reports for any issues you can find, or request potential features you'd like to see [here](../../issues). If you wish to contribute code to the project, refer to the contributing guidelines [here](.github/CONTRIBUTING.md) which includes dev environment setup. Please follow the [code of conduct](.github/CODE_OF_CONDUCT.md) when contributing.\n\n## License\n\nThis Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.\n\nView the [license](LICENSE.txt) file for more details.\n\n## Acknowledgments\n\n* [xUnit](https://xunit.github.io/): For running tests.\n* [Coverlet](https://github.com/tonerdo/coverlet) + [ReportGenerator](https://danielpalme.github.io/ReportGenerator/) + [CodeCov](https://codecov.io/): For test coverage.\n* [Bullseye](https://github.com/adamralph/bullseye) + [SimpleExec](https://github.com/adamralph/simple-exec) + [MinVer](https://github.com/adamralph/minver): For project building.\n* [GitHub](https://github.com/): For hosting code.\n* [Microsoft](https://visualstudio.microsoft.com/vs/features/net-development/): For C# and editors.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCreateAndFake%2FCreateAndFake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCreateAndFake%2FCreateAndFake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCreateAndFake%2FCreateAndFake/lists"}