Mocking framework for use with xamarin android

后端 未结 3 1098
[愿得一人]
[愿得一人] 2020-12-20 04:44

I am trying to find a mocking framework that works with Xamarin Android. So far I have tried Rhino Mocks and Moq but both depend on System.Web.dll which does not seem to be

3条回答
  •  孤城傲影
    2020-12-20 05:09

    You can use True Fakes (http://truefakes.net) 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 (https://www.nuget.org/packages/TrueFakes/). Please see more information about True Fakes at http://truefakes.net.

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

提交回复
热议问题