Enabling database properties general tab with real time values from SMO (#2093)

* initial commit with all required db handler and props, also getting the data from ADS

* database properties view updated

* Delete Microsoft.SqlTools.ServiceLayer.sln

This file should be ignored

* Removed unwanted file

* Using DatabaseHandler for properties as one handler per object

* removed unused and unnecessary changes

* minimal updates

* moving type conversion to UI side, properties with original types.

* conversion number fixed

* Adding Localized strings

* using existing objectUrn logic to get the smo object

* Adding Integration tests for database properties verification

* refactoring

* updating test
This commit is contained in:
Sai Avishkar Sreerama
2023-06-21 19:41:18 -05:00
committed by GitHub
parent 532f7b0912
commit 5c7dae40e6
9 changed files with 141 additions and 15 deletions

View File

@@ -70,7 +70,9 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.ObjectManagement
CollationName = "SQL_Latin1_General_CP1_CI_AS",
CompatibilityLevel = "SQL Server 2022 (160)",
ContainmentType = "None",
RecoveryModel = "Full"
RecoveryModel = "Full",
LastDatabaseBackup = "None",
LastDatabaseLogBackup = "None"
};
}
@@ -152,6 +154,26 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.ObjectManagement
await Service.HandleDisposeViewRequest(new DisposeViewRequestParams { ContextId = parameters.ContextId }, disposeViewRequestContext.Object);
}
internal static async Task<DatabaseViewInfo> GetDatabaseObject(InitializeViewRequestParams parameters, SqlObject obj)
{
// Initialize the view
DatabaseViewInfo databaseViewInfo = new DatabaseViewInfo();
var initViewRequestContext = new Mock<RequestContext<SqlObjectViewInfo>>();
initViewRequestContext
.Setup(x => x.SendResult(It.IsAny<SqlObjectViewInfo>()))
.Returns(Task.FromResult<SqlObjectViewInfo>(null))
.Callback<DatabaseViewInfo>(r => databaseViewInfo = r);
await Service.HandleInitializeViewRequest(parameters, initViewRequestContext.Object);
// Dispose the view
var disposeViewRequestContext = new Mock<RequestContext<DisposeViewRequestResponse>>();
disposeViewRequestContext.Setup(x => x.SendResult(It.IsAny<DisposeViewRequestResponse>()))
.Returns(Task.FromResult<DisposeViewRequestResponse>(new DisposeViewRequestResponse()));
await Service.HandleDisposeViewRequest(new DisposeViewRequestParams { ContextId = parameters.ContextId }, disposeViewRequestContext.Object);
return databaseViewInfo;
}
internal static async Task<string> ScriptObject(InitializeViewRequestParams parameters, SqlObject obj)
{
// Initialize the view