Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are Fakes assembly in Visual Studio 2013?

Tags:

There are a lot of question on how to add Fakes Assembly but no one on what they are and what they are used for.

like image 257
Revious Avatar asked Mar 20 '14 10:03

Revious


1 Answers

Fakes are used to mock or stub code for testing purposes. E.g., instead of connecting directly to a database in a unit test you create a fake of the class that accesses the database that "fakes" just enough behavior to be used instead of the real database. This isolates the unit test from the remaining system.

You can read more about fakes in Isolating Code Under Test with Microsoft Fakes.

like image 173
Martin Liversage Avatar answered Sep 28 '22 10:09

Martin Liversage