Fix default test server names file path construction (#941)

FileUtils.TestServerNamesDefaultFileName_get uses '… + @"\\" + …'
construct to build the default path for the test server names file.
While escaping a backslash in a verbatim string is a typo, the
approach was error-prone. Replace string manipulation and environment
variables magic with calls to well-tested library functions.

GetSettingFileContent() displays a message on switching to VS Code
settings when SQL connection instances were configured.
Move the message to the branch for the absent test configuration file.
This commit is contained in:
Aleksei Guzev
2020-04-06 18:43:02 +03:00
committed by GitHub
parent 6cecba4f85
commit 1cb0b98148
2 changed files with 13 additions and 4 deletions

View File

@@ -152,11 +152,11 @@ namespace Microsoft.SqlTools.ServiceLayer.Test.Common
if (File.Exists(DefaultSettingFileName))
{
settingsFileName = DefaultSettingFileName;
Console.WriteLine(DefaultSettingFileName + " SQL connection instances are not configured. Will try to get connections from VS code settings.json");
}
else
{
//If the SQL connection settings is not set use the VS code one
Console.WriteLine(DefaultSettingFileName + " SQL connection instances are not configured. Will try to get connections from VS code settings.json");
settingsFileName = FileUtils.VsCodeSettingsFileName;
}
}