mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-30 17:24:37 -05:00
Add error for sql bindings when .net 5 (#1259)
* add error for sql bindings when .net 5 * add test * cleanup linq stuff and move out common code
This commit is contained in:
@@ -165,7 +165,6 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.AzureFunctions
|
||||
string testFile = Path.Join(Path.GetTempPath(), $"NoAzureFunctions-{DateTime.Now.ToString("yyyy - dd - MM--HH - mm - ss")}.cs");
|
||||
FileStream fstream = File.Create(testFile);
|
||||
fstream.Close();
|
||||
|
||||
GetAzureFunctionsParams parameters = new GetAzureFunctionsParams
|
||||
{
|
||||
filePath = testFile
|
||||
@@ -178,5 +177,24 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.AzureFunctions
|
||||
Assert.Null(result.ErrorMessage);
|
||||
Assert.AreEqual(0, result.azureFunctions.Length);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verify there are no errors when a file doesn't have any Azure functions
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void GetAzureFunctionsNet5()
|
||||
{
|
||||
string testFile = Path.Join(testAzureFunctionsFolder, "AzureFunctionsNet5.cs");
|
||||
|
||||
GetAzureFunctionsParams parameters = new GetAzureFunctionsParams
|
||||
{
|
||||
filePath = testFile
|
||||
};
|
||||
|
||||
GetAzureFunctionsOperation operation = new GetAzureFunctionsOperation(parameters);
|
||||
|
||||
Exception ex = Assert.Throws<Exception>(() => { operation.GetAzureFunctions(); });
|
||||
Assert.AreEqual(SR.SqlBindingsNet5NotSupported, ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user