I have some methods in my app that make http requests. Is there a good way to simulate network failures and bad responses for the unit tests?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Suitable Mock Objects should let you perform such simulations easily; if you’re unfamiliar with the concept, there’s a good tutorial here.