If the test name file cannot be found just use the settings.json

This commit is contained in:
Leila Lali
2016-11-09 16:12:11 -08:00
parent 92420e734f
commit 18bf76caed
6 changed files with 81 additions and 18 deletions

View File

@@ -18,9 +18,18 @@ namespace Microsoft.SqlTools.ServiceLayer.TestDriver.Tests
{
public class PerformanceTests : TestBase
{
private static string ComplexQuery = File.ReadAllText("./Scripts/AdventureWorks.sql");
private static string ComplexQuery = LoadComplexScript();
private static string SimpleQuery = "SELECT * FROM sys.all_columns";
private static string LoadComplexScript()
{
string assemblyLocation = System.Reflection.Assembly.GetEntryAssembly().Location;
string folderName = Path.GetDirectoryName(assemblyLocation);
string filePath = Path.Combine(folderName, "Scripts/AdventureWorks.sql");
return File.ReadAllText(filePath);
}
[Fact]
public async Task HoverTestOnPrem()
{
@@ -556,6 +565,8 @@ namespace Microsoft.SqlTools.ServiceLayer.TestDriver.Tests
TestTimer timer = new TestTimer();
T result = await testToRun();
timer.EndAndPrint(testName);
return result;
}
}