如何使用NUnit测试来测试RestFul wcf服务? [英] How can I use NUnit test to test RestFul wcf services?

查看:77
本文介绍了如何使用NUnit测试来测试RestFul wcf服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在NUnit测试项目中为REstful WCF服务编写测试用例

如何使用NUnit测试来测试RestFul wcf服务?



在此先感谢....

I wanna to write test cases in NUnit test project for REstful WCF service.
How can I use NUnit test to test RestFul wcf services?

Thanks in advance....

推荐答案

您可以使用HTTPWebRequest / HttpWebResponse类做出请求/解密响应。请查看以下内容:

http:// msdn .microsoft.com / zh-cn / library / system.net.httpwebrequest.aspx [ ^ ]



对于简单请求,您还可以使用fiddler或restclient(jar)应用程序。
you can use the HTTPWebRequest/HttpWebResponse classes to make the requests/decipher response. Check out this for the usage:
http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.aspx[^]

For simple requests you could also use fiddler or restclient(jar) apps.


同步:

http: //msdn.microsoft.com/en-IN/library/d4cek6cc.aspx [ ^ ]



异步:

http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.begingetrequeststream.aspx [ ^ ]
Sync:
http://msdn.microsoft.com/en-IN/library/d4cek6cc.aspx[^]

Async:
http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.begingetrequeststream.aspx[^]


我创建了一个NUnit项目,我有一个直接调用的测试用例休息服务,我们可以测试该响应的预期响应。
I have created one NUnit project and I have test case which directly calls to the rest service and we can test that response with expected response.


这篇关于如何使用NUnit测试来测试RestFul wcf服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆