.net - WAP + NUnit + WebConfigurationManager Pin -


I have started using NUnit to write test cases for my asp.net web application project yet .

Brings the connection string to a "section" defined under the "config files" of the "config file" code written for getting some database values.

It works fine on the Web browser during the normal execution of the project, but when I use the same method through a test case, the Web Configuration Manager .tatched () always gives blank space.

Initially I was not able to access the WebSettings section of web.config, but when I copied it to the Web.config file in the Bin folder but still "section" inside "Configuration" Not able to.

Please suggest.

By default NUnit will look for a config file which is in the same name as the test included Are there. So if you have some Test.dll, then NUnit will select some Test.dll.config. So for the standard this trick is to match the dll name pattern to make a copy of your app.config. I think the web app also works for you. You will copy web.config to some Test.dll.config But honestly, I usually do not write tests that need to be in config, so I certainly do not know.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -