All Projects → kentcb → Pclmock

kentcb / Pclmock

Licence: mit
A simple mocking framework in a PCL.

Projects that are alternatives of or similar to Pclmock

Fake Xrm Easy
The testing framework for Dynamics CRM and Dynamics 365 which runs on an In-Memory context and deals with mocks or fakes for you
Stars: ✭ 216 (+440%)
Mutual labels:  mock, mocking-framework
IOS-CoreBluetooth-Mock
Mocking library for CoreBluetooth framework.
Stars: ✭ 142 (+255%)
Mutual labels:  mock, mocking-framework
Jest Mock Extended
Type safe mocking extensions for Jest https://www.npmjs.com/package/jest-mock-extended
Stars: ✭ 224 (+460%)
Mutual labels:  mock, mocking-framework
Logginginterceptor
An OkHttp interceptor which has pretty logger for request and response. +Mock support
Stars: ✭ 1,149 (+2772.5%)
Mutual labels:  mock, mocking-framework
Mimic
Seamless client side mocking
Stars: ✭ 380 (+850%)
Mutual labels:  mock, mocking-framework
Pegomock
Pegomock is a powerful, yet simple mocking framework for the Go programming language
Stars: ✭ 215 (+437.5%)
Mutual labels:  mock, mocking-framework
mocat
🐈 Mocat is a mocking toolbar that allows you to interactively develop and test network requests.
Stars: ✭ 27 (-32.5%)
Mutual labels:  mock, mocking-framework
Mockito
Most popular Mocking framework for unit tests written in Java
Stars: ✭ 12,453 (+31032.5%)
Mutual labels:  mock, mocking-framework
Mockolo
Efficient Mock Generator for Swift
Stars: ✭ 327 (+717.5%)
Mutual labels:  mock, mocking-framework
amoss
Amoss - Apex Mock Objects, Spies and Stubs - A Simple Mocking framework for Apex (Salesforce)
Stars: ✭ 55 (+37.5%)
Mutual labels:  mock, mocking-framework
Mockito Scala
Mockito for Scala language
Stars: ✭ 231 (+477.5%)
Mutual labels:  mock, mocking-framework
Kakapo.js
🐦 Next generation mocking framework in Javascript
Stars: ✭ 535 (+1237.5%)
Mutual labels:  mock, mocking-framework
umock-c
A pure C mocking library
Stars: ✭ 29 (-27.5%)
Mutual labels:  mock, mocking-framework
Mockk
mocking library for Kotlin
Stars: ✭ 4,214 (+10435%)
Mutual labels:  mock, mocking-framework
Msw
Seamless REST/GraphQL API mocking library for browser and Node.js.
Stars: ✭ 7,830 (+19475%)
Mutual labels:  mock, mocking-framework
Cpputest
CppUTest unit testing and mocking framework for C/C++
Stars: ✭ 896 (+2140%)
Mutual labels:  mocking-framework
Node Quick Mock
🌞 基于Express的mock接口平台
Stars: ✭ 33 (-17.5%)
Mutual labels:  mock
Hel
Hel rules over Helheim, where the souls unworthy of Valhalla reside. It's also a mock generator for Go.
Stars: ✭ 16 (-60%)
Mutual labels:  mock
Microservices
A microservices environment managed by Docker Compose.
Stars: ✭ 16 (-60%)
Mutual labels:  portable
Yannl
Yet another neural network library
Stars: ✭ 37 (-7.5%)
Mutual labels:  portable

Logo

PCLMock

Build status

What?

PCLMock is a lightweight, but powerful mocking framework targeting .NET Standard 1.0 (it was originally a Portable Class Library, hence the name).

Why?

At the time of inception, existing mocking frameworks (such as Moq) 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.

Where?

The easiest way to get PCLMock is via NuGet:

Install-Package PCLMock

There are also packages specific to code generation.

How?

Mocks can be created automatically via code generation 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.

Test code can utilize the mocks in various ways. Here is a typical example:

[Fact]
public void some_test()
{
    var mockService = new SomeServiceMock();
	mockService
	    .When(x => x.Login(It.IsAny<string>(), "123456"))
	    .Return(true);

    var sut = new Foo(mockService);

    // some test code here

    mockService
        .Verify(x => x.Login("me", "123456"))
        .WasNotCalled();
}

For a detailed discussion, read the documentation on using mocks.

Who?

PCLMock is created and maintained by Kent Boogaart. Issues and pull requests are welcome.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].