Unit testing with Android volley

后端 未结 4 1637
鱼传尺愫
鱼传尺愫 2020-12-13 17:30

I would like to know how can I create unit tests for the volley framework. Mock the requests, the responses so that I can create unit tests that wont require a webservice to

4条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-13 18:25

    Not 100% sure that I understand what you want to do, but if I do, then easymock (a lib that allows the creation of mock classes, that you can make calls to and receive predetermined responses) will help you out a lot. A guy called Lars Vogel has a nice article on this topic that I found useful a while back when I used it.

    http://www.vogella.com/articles/EasyMock/article.html

提交回复
热议问题