{"id":13629412,"url":"https://github.com/JasonBock/Rocks","last_synced_at":"2025-04-17T09:33:39.418Z","repository":{"id":27076001,"uuid":"30542524","full_name":"JasonBock/Rocks","owner":"JasonBock","description":"A mocking library based on the Compiler APIs (Roslyn + Mocks)","archived":false,"fork":false,"pushed_at":"2024-05-20T15:13:23.000Z","size":16536,"stargazers_count":198,"open_issues_count":15,"forks_count":17,"subscribers_count":12,"default_branch":"main","last_synced_at":"2024-05-22T04:33:26.088Z","etag":null,"topics":["csharp","csharp-sourcegenerator","mock","mocking","testing"],"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/JasonBock.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-02-09T15:28:40.000Z","updated_at":"2024-06-14T01:32:19.643Z","dependencies_parsed_at":"2023-01-14T09:15:25.270Z","dependency_job_id":"e3cc9387-d639-475b-94de-783bccb9ac92","html_url":"https://github.com/JasonBock/Rocks","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JasonBock%2FRocks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JasonBock%2FRocks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JasonBock%2FRocks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JasonBock%2FRocks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JasonBock","download_url":"https://codeload.github.com/JasonBock/Rocks/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223751095,"owners_count":17196567,"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":["csharp","csharp-sourcegenerator","mock","mocking","testing"],"created_at":"2024-08-01T22:01:09.842Z","updated_at":"2025-04-17T09:33:39.391Z","avatar_url":"https://github.com/JasonBock.png","language":"C#","readme":"# Rocks\n\n[![NuGet](https://img.shields.io/nuget/v/Rocks.svg)](https://www.nuget.org/packages/Rocks)\n\n[![Bugs](https://img.shields.io/github/issues/JasonBock/Rocks/bug)](https://github.com/JasonBock/Rocks/issues?q=is%3Aissue%20state%3Aopen%20label%3Abug)\n\n[![Issues](https://img.shields.io/github/issues/JasonBock/Rocks)](https://github.com/JasonBock/Rocks/issues)\n\n![Rocks logo](https://raw.github.com/JasonBock/Rocks/main/src/Images/Banner-Small.png)\n\nA mocking library based on the Compiler APIs (Roslyn + Mocks).\n\n## Getting Started\n\nReference the `Rocks` [NuGet package](https://www.nuget.org/packages/Rocks) - that's it.\n\n### Prerequisites\n\nThe Rocks package targets .NET Standard 2.0 for host flexibility. That said, Rocks (as of `9.0.0`) will generate code that requires .NET 9.\n\n## Usage\n\nTo make a mock, you take an interface or an unsealed class that has virtual members:\n\n```csharp\npublic interface IAmSimple\n{\n  void TargetAction();\n}\n```\n\nand you use Rocks to create a mock with expectations, along with verifying its usage:\n\n```csharp\n[assembly: Rock(typeof(IAmSimple), BuildType.Create)]\n\nvar expectations = new IAmSimpleCreateExpectations();\nexpectations.Methods.TargetAction();\n\nvar mock = expectations.Instance();\nmock.TargetAction();\n\nexpectations.Verify();\n```\n\nMore details can be found on the [Overview page](https://github.com/JasonBock/Rocks/blob/main/docs/Overview.md).\n\n## Additional Documentation\n\n* [Discord Server](https://discord.gg/ZXMhkKsMRb)\n* [Changelog](https://github.com/JasonBock/Rocks/blob/main/changelog.md)\n* [Unit testing best practices with .NET Core and .NET Standard](https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-best-practices)\n* [BenchmarkMockNet](https://github.com/ecoAPM/BenchmarkMockNet)\n\n## Feedback\n\nIf you run into any issues, please add them [here](https://github.com/JasonBock/Rocks/issues).\n","funding_links":[],"categories":["Content","csharp","Source Generators","testing"],"sub_categories":["24. [Rocks](https://ignatandrei.github.io/RSCG_Examples/v2/docs/Rocks) , in the [Tests](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#tests) category","Testing"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJasonBock%2FRocks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJasonBock%2FRocks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJasonBock%2FRocks/lists"}