Use the config (Web. config) file in nunit

Source: Internet
Author: User
To use nunit to implement ASP. the unit test of the dataaccess layer in. Net cannot be normally read and stored on the web. the connectionstring information in config. After one night, I finally saw the specific ending scheme written by others on the Internet. Excited, copy it first

Refer to msdn to find a solution.
1. Copy the Web. config file to the output path of the nunit test project (such as bin/debug), which is the same directory as the generated DLL.
2. Rename the Web. config file to "DLL file name +. config"
(DLL files are generated by the test project)
For example, the DLL file generated by the test project is named "aspalliance. Data. unittests. dll"
The Config File name is "aspalliance. Data. unittests. dll. config"
3. Complete. This is used like Web. config. Unfortunately, you need to make two changes each time you change the config.

Thoughts:
In fact, it is very simple, that is, ASP. NET (or webformsProgramThe default config file is Web. config, and the default config file of C # (winforms) is assembly (assembly) name + ". config"

Shuang

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.