Auto-Mocking with Foq and AutoFixture
19 October 2013
A new Auto-mocking extension have been recently added to AutoFixture allowing the mock instances to be created by Foq.
This brings the total number of Auto-mocking extensions for AutoFixture up to five:
To install AutoFixture with Auto Mocking using Foq, run the following command in the Package Manager Console:
To use it, add an
AutoFoqCustomization to the
In the test below the mocked instance is created automatically by Foq:
The above test can be written declaratively using AutoData theories:
[AutoFoqData] attribute is defined as:
An automatically published release created from the latest successful build can be also downloaded from here.