Timeline for How to unit test a web client?
Current License: CC BY-SA 3.0
9 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Dec 2, 2013 at 1:32 | comment | added | actual_kangaroo | Oh ok, my C# missunderstanding, I thaught the Client object was the webservice. The second example shows stubbing out the client and testing the "LoggerOnner" code that uses the client. | |
| Dec 2, 2013 at 1:29 | history | edited | actual_kangaroo | CC BY-SA 3.0 | added 11 characters in body |
| Dec 1, 2013 at 14:03 | vote | accept | Sherlock | ||
| Dec 1, 2013 at 13:42 | comment | added | Marjan Venema | @Eru: you can by stubbing out the webservice. The client needs to be tested to ensure that it properly passes the necessary information and reacts appropriately to the responses it receives. The stub class taking the role of the webservices can and should be as simple as possible, preferably without any further dependencies, as it sole goal is to support the testing of the client. In other words: where you w/should normally never rely on hard coded values, it is ok to do so in a test stub. | |
| Dec 1, 2013 at 13:19 | history | edited | actual_kangaroo | CC BY-SA 3.0 | added 113 characters in body |
| Dec 1, 2013 at 13:06 | history | edited | actual_kangaroo | CC BY-SA 3.0 | added 113 characters in body |
| Dec 1, 2013 at 13:02 | comment | added | actual_kangaroo | oh i see now that's the client your testing. Similar advice though, You cann't unit test the method that calls the web service so try and make that method as small as posible | |
| Dec 1, 2013 at 12:47 | comment | added | Sherlock | I don't understand how this can be tested though. What would I need to verify in the test for such a simple method (make request, check response, return true) ? | |
| Dec 1, 2013 at 12:03 | history | answered | actual_kangaroo | CC BY-SA 3.0 |