0

when I'm using Moles in my Unittest it is not possible to get value from the of the appconfig by using the configurationManager.

I know this a known issue but I'm wondering if can find good workaround (some trick) to resolve this problem apart from faking by using following solution http://social.msdn.microsoft.com/Forums/en/pex/thread/9b4b9ec5-582c-41e8-8b9c-1bb9457ba3f6

Thanks!!!

1 Answers1

0

One option that I have used, that is relatively simple, is to just add the setting in code within your tests:

ConfigurationManager.AppSettings["FolderPathInConfig"] = 
            Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "TestData");
Kipp
  • 711
  • 7
  • 10