Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

The easy mocking library for .NET

License

NotificationsYou must be signed in to change notification settings

FakeItEasy/FakeItEasy

Repository files navigation

Are you mocking me?

NuGet versionBuild status

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.varshop=A.Fake<ICandyShop>();// Easily set up a call to return a value.varlollipop=newLollipop();A.CallTo(()=>shop.GetTopSellingCandy()).Returns(lollipop);// Exercise your system under test by using the fake as you// would an instance of the faked type.varcustomer=newSweetTooth();customer.BuyTastiestCandy(shop);// Asserting uses the same syntax as configuring calls.A.CallTo(()=>shop.BuyCandy(lollipop)).MustHaveHappened();

Resources


FakeItEasy logo designed byVanja Pakaski.


[8]ページ先頭

©2009-2025 Movatter.jp