{"id":17868266,"url":"https://github.com/matmoore/kotlin-test-factory","last_synced_at":"2025-04-02T22:26:44.271Z","repository":{"id":233668508,"uuid":"630351656","full_name":"MatMoore/kotlin-test-factory","owner":"MatMoore","description":"Kotlin library for creating test factories","archived":false,"fork":false,"pushed_at":"2023-04-24T08:20:08.000Z","size":70,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-08T12:47:10.929Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MatMoore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-04-20T07:43:26.000Z","updated_at":"2023-04-20T15:54:01.000Z","dependencies_parsed_at":"2024-04-17T03:52:00.706Z","dependency_job_id":"56bae7d3-4990-4268-9e74-ce6ae04057cf","html_url":"https://github.com/MatMoore/kotlin-test-factory","commit_stats":null,"previous_names":["matmoore/kotlin-test-factory"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatMoore%2Fkotlin-test-factory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatMoore%2Fkotlin-test-factory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatMoore%2Fkotlin-test-factory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatMoore%2Fkotlin-test-factory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MatMoore","download_url":"https://codeload.github.com/MatMoore/kotlin-test-factory/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246901634,"owners_count":20852256,"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":[],"created_at":"2024-10-28T09:57:27.042Z","updated_at":"2025-04-02T22:26:44.249Z","avatar_url":"https://github.com/MatMoore.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Test factory\n\nTest factory lets you define factory classes for use in unit tests,\ninspired by FactoryBot in ruby. Test factories provide default values\nfor constructing kotlin classes, so that you only have to specify things\nthat matter to your test.\n\nThis is an experimental learning project.\n\n## Usage\n\n### Defining test factories\n\nTest factories should inherit from the TestFactory class like so:\n\n```kotlin\nclass FooFactory: TestFactory\u003cFoo\u003e(Foo::class) {\n    val bar = 123\n    val baz = \"hello\"\n}\n```\n\n### Using test factories\n\nIn your tests you can now construct objects like this:\n\n```kotlin\nval foo = FooFactory().build()\n```\n\nThis will call the primary constructor of the class with the values defined on the factory.\n\nThe constructor parameters can be arbitrarily overriden at the call site by creating an anonymous object that\nsubclasses the factory, e.g.\n\n```kotlin\nval foo = object : FooFactory() { override val bar = 2 }.build()\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatmoore%2Fkotlin-test-factory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatmoore%2Fkotlin-test-factory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatmoore%2Fkotlin-test-factory/lists"}