Link to home
Start Free TrialLog in
Avatar of Erwin Pombett
Erwin PombettFlag for Switzerland

asked on

how can i set App.Config values while testing with nunit?

how can i set values in order to test my code.

   public Hashtable MyMethod()
        {
            string _pathFTP = ConfigurationSettings.AppSettings["FTP_HOST_FEEDING_CONTAINER"];
            string _user = ConfigurationSettings.AppSettings["FTP_USER"];
            string _pass = ConfigurationSettings.AppSettings["FTP_PASS"];

          ...
         }


  now , i'd like to test this with Nunit,
i have a test method as follow.

 [Test]
public void testing MyMethod(){
                      <---- how can i set my ftp values, as they are not existent in my method process while testing
    assert(...);
}

the aim is not to change my method code,
ASKER CERTIFIED SOLUTION
Avatar of oxyoo
oxyoo
Flag of Sweden image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial