How To Read UnitTest Project's App.Config From Test With HostType(“Moles”)
I have the folowing tests: [TestClass] public class GeneralTest { [TestMethod] public void VerifyAppDomainHasConfigurationSettings() { string value = ConfigurationManager.AppSettings["TestValue"]; Assert.IsFalse(String.IsNullOrEmpty(value), "No App.Config found."); } [TestMethod] [HostType("Moles")] public void VerifyAppDomainHasConfigurationSettingsMoles() { string value = ConfigurationManager.AppSettings["TestValue"]; Assert.IsFalse(String.IsNullOrEmpty(value), "No App.Config found."); } } The only difference between them is [HostType("Moles")] . But the first passes and the second fails.