简体   繁体   English

如何检查单元测试进行的HTTP调用?

[英]How can I check the HTTP calls my unit test makes?

I am using Visual Studio 2015. This link makes it look easy: 我正在使用Visual Studio2015。此链接使它看起来很容易:

https://blogs.msdn.microsoft.com/visualstudio/2015/05/04/introducing-visual-studios-network-tool/ https://blogs.msdn.microsoft.com/visualstudio/2015/05/04/introducing-visual-studios-network-tool/

However, that menu option does not exist. 但是,该菜单选项不存在。 Instead, it is under the Analyze > Performance Profiler menu. 相反,它位于“分析”>“性能分析器”菜单下。 However, the network profiling tools are not selectable: 但是,无法选择网络配置工具:

在此处输入图片说明

I have set the startup project to be my unit test project, but no luck. 我已经将启动项目设置为我的单元测试项目,但是没有运气。

My question: when running a unit test, how can I check what network calls are made? 我的问题:运行单元测试时,如何检查进行了哪些网络调用?

Fiddler is a good alternative if no one is able to help you get VS2015 working. 如果没有人能够帮助您使VS2015正常运行,Fiddler是一个不错的选择。 Also works for all HTTP traffic from your box and can decrypt HTTPS 也适用于您盒子中的所有HTTP流量,并且可以解密HTTPS

http://www.telerik.com/fiddler http://www.telerik.com/fiddler

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 抛出HttpException时,如何编写单元测试来检查http状态代码? - How can I write a unit test to check the http status code when HttpException is thrown? 如何在我的 MSTest 单元测试中检查“没有发生异常”? - How do I check “no exception occurred” in my MSTest unit test? 如何使用 Http 和计时器对 blazor 组件进行单元测试? - How can I unit test a blazor component with Http and a Timer? 如何提取用 ok 发送的字符串以在单元测试中检查它 - How can I extract the string sent with the ok to check it in unit test 无法对调用静态方法的方法进行单元测试,如何重新设计该程序? - Can't unit test a method which calls a static method, how can I re-design this program? 如何对WCF客户端类进行单元测试? - How can I unit test my WCF client class? 我怎么知道我的程序在单元测试环境下 - How can I tell that my program is under unit test environment 如何对自定义验证属性进行单元测试 - How can I unit test my custom validation attribute 如何为我的后台服务编写单元测试? - How can I write unit test for my background service? 如何对实体上下文进行单元测试 - How I can unit-test my entity context
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM