+1 for option 2 On Thu, Oct 1, 2009 at 5:18 AM, Alex McMahon <[email protected]> wrote:
> I go for option 2. In theory it'd be nice to do some sort of integration > test to check that the actual service was consumable > > 2009/9/30 Brett <[email protected]> > > >> This is not necessarily specific to Rhino.Mocks, but I'm sure it is >> possible to use Rhino.Mocks as a solution. What is the best way to >> achieve test coverage of code which consumes web services without >> actually consuming the services during testing? If we use the old >> NYSE service example and I have code which calls a stock exchange >> service to get the current value of a symbol, I can think of two >> options. >> >> 1. Generate a service stub based on the wsdl and implement a fake >> version of the service on my local machine which unit tests could >> call. In that case, for example I would always return $5.00 or >> whatever for any symbol. >> >> 2. Wrap the service call with an interface and have 2 impls of that >> interface; one which consumes the service and one which just returns a >> value. >> >> I like option 2 better because you take out the http traffic in unit >> tests, but wasn't sure what had been done in the past. Are there >> better options? >> >> Thanks, >> Brett >> >> >> > > > > -- Tim Barcz Microsoft ASPInsider http://timbarcz.devlicio.us http://www.twitter.com/timbarcz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Rhino.Mocks" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rhinomocks?hl=en -~----------~----~----~----~------~----~------~--~---
