{"id":23669132,"url":"https://github.com/kentcb/pclmock","last_synced_at":"2025-10-29T09:16:55.789Z","repository":{"id":21094769,"uuid":"24394801","full_name":"kentcb/PCLMock","owner":"kentcb","description":"A simple mocking framework in a PCL.","archived":false,"fork":false,"pushed_at":"2020-05-23T02:06:51.000Z","size":44742,"stargazers_count":44,"open_issues_count":5,"forks_count":9,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-04-29T22:17:39.337Z","etag":null,"topics":["c-sharp","dotnet","mock","mocking-framework","portable"],"latest_commit_sha":null,"homepage":null,"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/kentcb.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}},"created_at":"2014-09-24T00:36:16.000Z","updated_at":"2024-01-29T15:28:05.000Z","dependencies_parsed_at":"2022-07-31T06:18:05.490Z","dependency_job_id":null,"html_url":"https://github.com/kentcb/PCLMock","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentcb%2FPCLMock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentcb%2FPCLMock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentcb%2FPCLMock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kentcb%2FPCLMock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kentcb","download_url":"https://codeload.github.com/kentcb/PCLMock/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231713149,"owners_count":18415200,"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":["c-sharp","dotnet","mock","mocking-framework","portable"],"created_at":"2024-12-29T08:17:53.214Z","updated_at":"2025-10-29T09:16:50.745Z","avatar_url":"https://github.com/kentcb.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Logo](Art/Logo150x150.png \"Logo\")\n\n# PCLMock\n\n[![Build status](https://ci.appveyor.com/api/projects/status/wj9tyg3m99jogmqw?svg=true)](https://ci.appveyor.com/project/kentcb/pclmock)\n\n## What?\n\n**PCLMock** is a lightweight, but powerful mocking framework targeting .NET Standard 1.0 (it was originally a Portable Class Library, hence the name).\n\n## Why?\n\nAt the time of inception, existing mocking frameworks (such as [Moq](https://github.com/Moq/moq4)) rely heavily on reflection and other mechanisms that are not available on more limited .NET runtimes, such as Mono. Writing mocks without the aid of a framework is laborious, error-prone, and results in inconsistent code. **PCLMock** aims to fill this gap.\n\n## Where?\n\nThe easiest way to get **PCLMock** is via [NuGet](http://www.nuget.org/packages/PCLMock/):\n\n```PowerShell\nInstall-Package PCLMock\n```\n\nThere are also packages specific to [code generation](Doc/generating-mocks.md).\n\n## How?\n\nMocks can be created automatically via [code generation](Doc/generating-mocks.md) or manually. Generally speaking, you will want to use one of the code generation packages to generate the bulk of your mock implementation. If, instead, you want to define mocks manually, read the documentation on [defining mocks](Doc/defining-mocks.md).\n\nTest code can utilize the mocks in various ways. Here is a typical example:\n\n```C#\n[Fact]\npublic void some_test()\n{\n    var mockService = new SomeServiceMock();\n\tmockService\n\t    .When(x =\u003e x.Login(It.IsAny\u003cstring\u003e(), \"123456\"))\n\t    .Return(true);\n\n    var sut = new Foo(mockService);\n\n    // some test code here\n\n    mockService\n        .Verify(x =\u003e x.Login(\"me\", \"123456\"))\n        .WasNotCalled();\n}\n```\n\nFor a detailed discussion, read the documentation on [using mocks](Doc/using-mocks.md).\n\n## Who?\n\n**PCLMock** is created and maintained by [Kent Boogaart](http://kent-boogaart.com). Issues and pull requests are welcome.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkentcb%2Fpclmock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkentcb%2Fpclmock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkentcb%2Fpclmock/lists"}