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