Mirror is a simple mocking framework for .NET
License
martydill/Mirror
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Mirror is a simple mocking framework for .NET, still in very early development. ------------------------------------------------------------------------------- It is designed for simplicity, with a small API surface, no complicated fluent interfaces, and a compiled binary size under 15k. Here are a few examples of its usage: Creating a mock: var mockRepo = new Mirror<IAccountRepository>(); Setting up a return value: mockRepo.Returns(r => r.GetAccount(1001), new Account()); Setting up a callback: mockRepo.Calls(r => r.GetAccount(1001), () => DoSomethingWhenAccountIsAccessed()); Setting up a thrown exception: mockRepo.Throws(r => r.DeleteAccount(89736), new AccountSecurityException()); Allowing parameters of any value, with Any<T>.Value: mockRepo.Returns(r => r.GetAccount(Any<int>.Value), new Account()); Determining how many times a method was called: Assert.AreEqual(1, mockRepo.Calls(r.GetAccount(1001)); Getting a T from a Mirror<T>: IAccountRepository accountRepository = mockRepo.It;
About
Mirror is a simple mocking framework for .NET
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published