You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to unit test a public class that contains an orchestrator method and a series of methods, which can be called by the orchestrator but also externally:
publicclassClassForTesting{publicvoidMethodA(){this.MethodA();this.MethodB();}publicvoidMethodB(){// Do some stuff.}publicvoidMethodC(){// Do some stuff.}}
My intention is to perform a test like the following one, but it can not be done without virtual methods:
Is there any alternative for testing this? Does any approach exist that I am not considering?
I have searched across Stack Overflow and the only alternative is using other frameworks, this is the reason why I am asking this directly in your github instead of in SO.
Thanks in advance
The text was updated successfully, but these errors were encountered:
AFAIK, the only tools that can intercept/replace non-overridable methods are those based on the .NET runtime's unmanaged profiling API (and Moq isn't one of those). So yes, either use a different mocking library, or change your code so it is more easily testable.
Hello,
I'm trying to unit test a public class that contains an orchestrator method and a series of methods, which can be called by the orchestrator but also externally:
My intention is to perform a test like the following one, but it can not be done without virtual methods:
Is there any alternative for testing this? Does any approach exist that I am not considering?
I have searched across Stack Overflow and the only alternative is using other frameworks, this is the reason why I am asking this directly in your github instead of in SO.
Thanks in advance
The text was updated successfully, but these errors were encountered: