Visual Studio - How to change the return value of a method in the debugger?

前端 未结 6 475
轻奢々
轻奢々 2021-01-02 08:12

When I\'m debugging, I often have to deal with methods that does not use an intermediate variable to store the return value :

   private int myMethod_1()
            


        
6条回答
  •  [愿得一人]
    2021-01-02 08:44

    What you need is Mocking. Checkout mocking frameworks like Rhinomock, Moq or Typemock.

    For the kind of scenario you are describing, I am going to assume that you may not have clean contract - driven development and may need to return in fake behaviour/state. In this case, Typemock may be the best option for you although it is commercial

提交回复
热议问题