If HostType as Moles, then i can't get data via ConfigurationManager.AppSettings
Its work fine for me 2-3 months before. But it is not worked and all my test cases are failed (raised the null reference exception).
Please help me to fix. thanks.
If HostType as Moles, then i can't get data via ConfigurationManager.AppSettings
Its work fine for me 2-3 months before. But it is not worked and all my test cases are failed (raised the null reference exception).
Please help me to fix. thanks.
This is a known bug in current versions of Moles in .Net 4.0 - You can Mole the configuration manager and have it return the values that you want as a workaround.
As an example, This is how I setup a test for a Linq To SQL DataContext to get code coverage for a default constructor without connecting to SQL.