Skip to content

connorivy/MockMe

Repository files navigation

MockMeFull

What is it?

MockMe is a library for mocking dependencies in your production code. Unlike other libraries that can only mock interfaces and virtual methods, MockMe can mock sealed classes and non-virtual methods.

Getting Started

Download NuGet package, then the source generators and the "MockMe.Mock" type will be available in your project.

var mock = Mock.Me<MyRepo>();

mock.Setup.ExpensiveDatabaseCall().Returns(99);

MyRepo myRepo = mock.MockedObject;

Assert.Equal(99, myRepo.ExpensiveDatabaseCall());
mock.Assert.ExpensiveDatabaseCall().WasCalled();

Check out the Wiki for more examples.

About

The concrete type mocking library for .NET

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages