FakeItEasy (9.0.1)
Published 2026-02-20 18:47:29 +03:30 by kayer
Installation
dotnet nuget add source --name kayer --username your_username --password your_token dotnet add package --source kayer --version 9.0.1 FakeItEasyAbout this package
It's faking amazing! The easy mocking library for .NET that works great in C# and VB.NET alike. No need to know the difference between a stub, a mock or a spy, everything's a fake! The easy to use, refactoring friendly API makes faking a breeze.
A .NET dynamic fake library for creating all types of fake objects, mocks, stubs etc.
- Easier semantics, all fake objects are just that - fakes - the use of the fakes determines whether they're mocks or stubs.
- Context-aware fluent interface guides the developer.
- Designed for ease of use.
- Full compatibility with both C# and VB.Net.
Faking amazing example
// Creating a fake object is very easy!
// No mocks, or stubs; everything's a fake.
var shop = A.Fake<ICandyShop>();
// Easily set up a call to return a value.
var lollipop = new Lollipop();
A.CallTo(() => shop.GetTopSellingCandy()).Returns(lollipop);
// Exercise your system under test by using the fake as you
// would an instance of the faked type.
var customer = new SweetTooth();
customer.BuyTastiestCandy(shop);
// Asserting uses the same syntax as configuring calls.
A.CallTo(() => shop.BuyCandy(lollipop)).MustHaveHappened();
Resources
- Website
- Quickstart
- Documentation
- Chat
- NuGet packages on NuGet.org, targeting:
- .NET Framework 4.6.2
- .NET 8.0
- .NET 10.0
FakeItEasy logo designed by Vanja Pakaski.
Dependencies
Details
2026-02-20 18:47:29 +03:30
Assets (2)
Versions (2)
View all
NuGet
15
Patrik Hägne, FakeItEasy contributors
646 KiB
fakeiteasy.9.0.1.nupkg
644 KiB
fakeiteasy.nuspec
1.7 KiB
