Mocking WebResponse's from a WebRequest

前端 未结 5 916
没有蜡笔的小新
没有蜡笔的小新 2020-12-07 18:43

I have finally started messing around with creating some apps that work with RESTful web interfaces, however, I am concerned that I am hammering their servers every time I h

5条回答
  •  没有蜡笔的小新
    2020-12-07 19:29

    You can't. Best thing to do is wrap it in a proxy object, and then mock that. Alternatively, you'd have to use a mock framework that can intercept types that can't be mocked, like TypeMock. But you're talking about bucks, there. Better to do a little wrapping.


    Apparently you can with a little extra work. Check the highest voted answer here.

提交回复
热议问题