开发者

Testing calls to third party webservices

开发者 https://www.devze.com 2023-02-19 03:36 出处:网络
As part of our object CRUD work flow we need to call third party web services. I am trying to find a way to unit test this. Obviously, I don\'t want / can\'t call the actual web services as they don\'

As part of our object CRUD work flow we need to call third party web services. I am trying to find a way to unit test this. Obviously, I don't want / can't call the actual web services as they don't exist yet. I do have the WSDL that they will be using. Does it 开发者_Go百科make sense to make my own "fake" service to match the WSDL and have the app call it or should I look into mocking frameworks?


"Faking" the service would be creating a mock. The question therefore boils down to, should you use a mocking framework, or should you mock based on the WSDL.

svcutil.exe can be used to make a service stub out of a WSDL. So it would be quickest in this case to not use a mocking framework like Moq. However, if you plan on mocking other things in your app, it might make sense to take the time to learn a Mocking framework and use that.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号