Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在测试一些业务对象的 Save() 方法。为了保存对象,我需要从配置管理器中读取连接字符串。但我得到的只是空值。我的设置在网站 web.config 中。如何在测试运行时获取。我需要额外的配置吗?
单元测试项目必须有它自己的配置文件。在项目中添加一个,并将您需要的连接字符串设置放入其中。