{"id":25501055,"url":"https://github.com/connorivy/MockMe","last_synced_at":"2025-11-11T22:30:20.487Z","repository":{"id":259737325,"uuid":"878168617","full_name":"connorivy/MockMe","owner":"connorivy","description":"The concrete type mocking library for .NET","archived":false,"fork":false,"pushed_at":"2025-01-31T18:27:45.000Z","size":2039,"stargazers_count":15,"open_issues_count":3,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-31T18:51:15.142Z","etag":null,"topics":[],"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/connorivy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-24T22:11:08.000Z","updated_at":"2025-01-31T18:26:31.000Z","dependencies_parsed_at":"2024-10-27T18:06:06.490Z","dependency_job_id":"db664454-d4d0-42b0-8ac4-000d6f7df54f","html_url":"https://github.com/connorivy/MockMe","commit_stats":null,"previous_names":["connorivy/mockme"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connorivy%2FMockMe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connorivy%2FMockMe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connorivy%2FMockMe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connorivy%2FMockMe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/connorivy","download_url":"https://codeload.github.com/connorivy/MockMe/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239592970,"owners_count":19664856,"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":"2025-02-19T04:01:58.897Z","updated_at":"2025-11-11T22:30:20.421Z","avatar_url":"https://github.com/connorivy.png","language":"C#","funding_links":[],"categories":["Content"],"sub_categories":["184. [MockMe](https://ignatandrei.github.io/RSCG_Examples/v2/docs/MockMe) , in the [Tests](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#tests) category"],"readme":"![MockMeFull](https://github.com/user-attachments/assets/43d8b58f-98b0-4469-95c3-7e5ca0683ffc)\n\n___\n\n[![Coverage Status](https://coveralls.io/repos/github/connorivy/MockMe/badge.svg?branch=main)](https://coveralls.io/github/connorivy/MockMe?branch=main)\n\n## What is it?\n\nMockMe is a library for mocking dependencies in your unit test projects. Unlike other libraries that can only mock interfaces and virtual methods, MockMe can mock sealed classes and non-virtual methods.\n\n## Getting Started\n\nImagine you have the following repository class\n```csharp\nsealed class MyRepo\n{\n    public int ExpensiveDatabaseCall() =\u003e // some code;\n}\n```\n\nDownload the MockMe NuGet package, then the source generators and the \"MockMe.Mock\" type will be available in your project.\nThen you can customize the behavior of the repository class as below.\n\n```csharp\nusing MockMe;\n\n// use this syntax to trigger the source generator to make a mock of the provided type\n// the 'mock' object will have 3 properties: Setup, Assert, and MockedObject\n// hint: rebuild test project after writing this line or IntelliSense may not work correctly\nvar mock = Mock.Me(default(MyRepo)); \n\n// the mock.Setup object has an identical interface to the original object\n// from there you can configure method behavior with 'Returns', 'Callback', 'Throws', etc\nmock.Setup.ExpensiveDatabaseCall().Returns(99);\n\n// the mock.MockedObject is a special instance of the mocked type which has the modified behavior\n// other instances of the mocked type will have the original behavior\nMyRepo myRepo = mock.MockedObject;\nint result = myRepo.ExpensiveDatabaseCall();\n\nAssert.Equal(99, result);\n\n// the mock.Assert object also has an identical interface to the original object.\n// you can use it to assert certain mock behaviors\nmock.Assert.ExpensiveDatabaseCall().WasCalled();\n\n```\n\nCheck out the [Wiki](https://github.com/connorivy/MockMe/wiki/QuickStart) for more examples.\n\n## Give it a Star \n\nIf you like this project, please give it a star!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconnorivy%2FMockMe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconnorivy%2FMockMe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconnorivy%2FMockMe/lists"}