Adding Support for new engine edition (#876)

* Adding Support for SqlOnDemand

* Updating unit test per comment

* Resolving comments. Enabling external table for sqlondemand

* Resolving comments. Enabling External tables for sqlondemand

* Enabling external tables for sqlondemand
This commit is contained in:
BranislavGrbicMDCS
2019-10-16 23:29:57 +02:00
committed by GitHub
parent 6f17c15d2c
commit 962ba3a12b
11 changed files with 239 additions and 128 deletions

View File

@@ -30,6 +30,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.ObjectExplorer
VerifyGetValidForFlag(SqlServerType.Sql2014, ValidForFlag.Sql2014);
VerifyGetValidForFlag(SqlServerType.Sql2016, ValidForFlag.Sql2016);
VerifyGetValidForFlag(SqlServerType.Sql2017, ValidForFlag.Sql2017);
VerifyGetValidForFlag(SqlServerType.SqlOnDemand, ValidForFlag.SqlOnDemand);
}
[Fact]
@@ -135,6 +136,14 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.ObjectExplorer
VerifyIsValidFor(serverValidFor, validFor, expected);
}
[Fact]
public void CalculateServerTypeShouldReturnSqlOnDemandGivenEngineEdition()
{
int engineEdition = 11;
SqlServerType expected = SqlServerType.SqlOnDemand;
VerifyCalculateServerTypeForEngineEdition(engineEdition, expected);
}
private void VerifyIsValidFor(ValidForFlag serverValidFor, ValidForFlag validFor, bool expected)
{
bool actual = ServerVersionHelper.IsValidFor(serverValidFor, validFor);
@@ -151,6 +160,17 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.ObjectExplorer
Assert.Equal(expected, actual);
}
private void VerifyCalculateServerTypeForEngineEdition(int engineEdition, SqlServerType expected)
{
ServerInfo serverInfo = new ServerInfo
{
EngineEditionId = engineEdition
};
SqlServerType actual = ServerVersionHelper.CalculateServerType(serverInfo);
Assert.True(actual == expected, $"Verify server type based on Engine Edition. Actual value: {actual}, Expected value: {expected}");
}
private void VerifyGetValidForFlag(SqlServerType serverType, ValidForFlag validForFlag)
{
ValidForFlag validforFlag = ServerVersionHelper.GetValidForFlag(serverType);