Forum Visual Studio

A Mocking Framework that will work with VS and Xamarin?

JennyLamJennyLam USMember, University

Are there any recommended Mocking framework that will work with VS and Xamarin 3? I tried to install EasyMoq, but it doesn't compile, can't find the T4 generator.dll that is supposed to be included.


Best Answer


  • JennyLamJennyLam USMember, University

    Manual mocking is an option, but was hoping we can point the mocker to an interface and it generates all the mocked objects for the interface. Will explore LightMock.

    thanks Jon!

  • You can use True Fakes ( mocking framework to solve your issues. It doesn’t use Reflection.Emit at runtime, but it automatically generates mocks at compile time and add it to assembly where unit-tests are. This allows you to use True Fakes for writing unit tests with fully isolated system under test for Xamarin.Android and Xamarin.iOS and running them directly on the device!

    You can add it to your project via NuGet (
    Please see more information about True Fakes at

    PS. I’m developer of True Fakes mocking framework.

  • tranb3rtranb3r FRMember ✭✭

    Is TrueFakes still maintained ? I can use the nuget package, but the website and documentation are down.
    Is there a good alternative ?

Sign In or Register to comment.