Testing – Microsoft Fakes

Microsoft fakes are quite useful when we want to quickly set up the framework for testing of basic dependency interactions. In case of complex in depth testing a third party mock frameworks are more suitable.

Create the fakes assembly by right-clicking System in the Unit Test Project’s References and select “Add Fakes Assembly”.


*The fakes are wrapped in a ShimsContext. Below sample test method.MSFAKE1

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s