The problem with NUnit and app.config

前端 未结 9 856
孤独总比滥情好
孤独总比滥情好 2020-12-29 19:48

When i run a simple test on connection to DB check i receive an error in NUnit:

[Test]
public void TestConn()
{
    string  connectionString = Configuration         


        
9条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-29 20:21

    Man give a look at: http://nunit.net/blogs/?p=9

    As him suggest I put a MyProjectTests.dll.config in project root and everything works.

    An example of my config file is:

    
    
      
         
    
    
    

    And I'm using the simple: ConfigurationManager.AppSettings["TestKey"];

提交回复
热议问题