是什么导致我运行单元测试时卡西尼号加载 [英] What causes Cassini to load when I run a unit test

查看:314
本文介绍了是什么导致我运行单元测试时卡西尼号加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个涉及MVC Web应用程序和几个类库的解决方案的测试项目。我正在使用模拟对象和System.Web.Abstractions来避免依赖ASP.NET内部对象。但是,当我开始测试项目时,Cassini就会加载。如果我立即停止卡西尼,我的所有测试仍会通过。那么为什么要加载呢?这并不是说它正在加载一个问题。但是,如果我做对了所有事情,似乎就不应加载。那么,是什么原因导致我在运行测试时加载该文件?

I have a test project for a solution which involves an MVC web application and several class libraries. I am using mock objects and System.Web.Abstractions to avoid dependencies on ASP.NET intrinsic objects. But when I start my test project Cassini loads. If I immediately stop cassini all my tests still pass. So why does it load? It's not that it's a problem that it's loading. But if I'm doing everything right it seems like it shouldn't load. So what causes it to load when I run my tests?

该项目正在进行很多更改,而且我有好几次都没有直接对其进行过研究天,所以我不确切知道Cassini何时开始运行。

A lot of changes are being made to the project and I haven't been working on it directly for a few days so I don't know exactly when Cassini started running.

推荐答案

好,所以我的问题的实际答案就在这里:如何您是否将VS2008配置为仅在具有多个项目的解决方案中打开一个Web服务器?

Ok, so the actual answer to my question is right here: How do you configure VS2008 to only open one webserver in a solution with multiple projects?

结果是,您可以转到属性窗口(选择项目- > F4),并通过将调试时始终启动设置为 false将其关闭。最后,这一直很烦人,甚至在我的测试项目完全不依赖Web项目时发生。

Turns out, that you can go to the properties window (select project -> F4) and turn this off by setting "Always Start When Debugging" to "false". Finally, this has always been so annoying and even happens when my test project has absolutely no dependencies on a web project.

这篇关于是什么导致我运行单元测试时卡西尼号加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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