What is use of Moq?

后端 未结 3 1598
栀梦
栀梦 2021-01-31 09:47

I keep seeing this referred to on DotNetKicks etc... Yet cannot find out exactly what it is (In English) or what it does? Could you explain what it is, or why I would use it?

3条回答
  •  不思量自难忘°
    2021-01-31 10:38

    Moq is a mocking framework for C#/.NET. It is used in unit testing to isolate your class under test from its dependencies and ensure that the proper methods on the dependent objects are being called. For more information on mocking you may want to look at the Wikipedia article on Mock Objects.

    Other mocking frameworks (for .NET) include JustMock, TypeMock, RhinoMocks, nMock, .etc.

提交回复
热议问题