public void GetAppSettingsValueByKey_GivenExistKey_GetCorrectValue() { var key = Constants.DataSourcePathKey; var expectedValue = TestConstants.DataSourcePath; var value = ConfigurationHandler.GetAppSettingsValueByKey(key); Assert.AreEqual(expectedValue, value); }
private static string GetDirectoryName() { var directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); if (string.IsNullOrEmpty(directoryName)) { directoryName = ConfigurationHandler.GetAppSettingsValueByKey(Constants.DataSourcePathKey); } return(directoryName); }