Since you are using VS2013 you can take advantage of Microsoft Fakes and Shims. More details and usage at http://msdn.microsoft.com/en-us/library/hh549175.aspx
Is there a .NET/C# mocking framework that doesn't require virtual methods
-
28-09-2022 - |
Pergunta
I'm trying to unit test a .NET web project with Visual Studio 2013's built-in tools. I have added Moq with NuGet, but can't test the controllers without rewriting the entire project with virtual methods and/or interfaces. So I am seeking a way to test the code without mucking about in the existing source code.
Thanks in advance for any help
Solução
Outras dicas
Perhaps check out FakeItEasy: http://fakeiteasy.github.io/
The three current libraries able to do "elevated" mocking are:
- JustMock ($399)
- TypeMock Isolator (€399/yr)
- Microsoft Fakes ($5999 - requires >>VS Enterprise<< omg)
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow