0

What would be the best approach to test Silverlight applications against WCF service communication errors?

I thought about implementing a separate service (from the same service interface) and force timeout exceptions. Then I would run SL using the same service reference but connecting to the second instance of the service (in another port for example).

Is this a good approach or there could be something to be done on the client side?

H.Scheidl
  • 815
  • 3
  • 11
  • 25

1 Answers1

0

I would do as you suggest, but it would be part of a unit test rather than a separate run-time setup. That is, I would have unit tests that mock the service in question and throw timeout exceptions. I would then assert that the view model reacts correctly to those exceptions.

Kent Boogaart
  • 175,602
  • 35
  • 392
  • 393
  • So basically I mock the WCF on the test right? Here [link](http://stackoverflow.com/questions/406955/easy-way-to-mock-a-wcf-service) some said RhinoMock/NMock can't do the job, what do you think? – H.Scheidl Jun 10 '11 at 06:31