mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 01:25:40 -05:00
Fix issues in file browser service (#469)
* fix file browser service bug * modify filebrowser service * change filebrowser contract * fix contract * fix file browser add/expand event contracts * remove commented code
This commit is contained in:
@@ -265,8 +265,8 @@ CREATE CERTIFICATE {1} WITH SUBJECT = 'Backup Encryption Certificate'; ";
|
||||
await service.RunFileBrowserOpenTask(openParams);
|
||||
|
||||
// Verify complete notification event was fired and the result
|
||||
serviceHostMock.Verify(x => x.SendEvent(FileBrowserOpenCompleteNotification.Type,
|
||||
It.Is<FileBrowserOpenCompleteParams>(p => p.Succeeded == true
|
||||
serviceHostMock.Verify(x => x.SendEvent(FileBrowserOpenedNotification.Type,
|
||||
It.Is<FileBrowserOpenedParams>(p => p.Succeeded == true
|
||||
&& p.FileTree != null
|
||||
&& p.FileTree.RootNode != null
|
||||
&& p.FileTree.RootNode.Children != null
|
||||
@@ -286,9 +286,11 @@ CREATE CERTIFICATE {1} WITH SUBJECT = 'Backup Encryption Certificate'; ";
|
||||
await service.RunFileBrowserExpandTask(expandParams);
|
||||
|
||||
// Verify result
|
||||
serviceHostMock.Verify(x => x.SendEvent(FileBrowserExpandCompleteNotification.Type,
|
||||
It.Is<FileBrowserExpandCompleteParams>(p => p.Succeeded == true
|
||||
&& p.ExpandedNode.FullPath == backupConfigInfo.DefaultBackupFolder)),
|
||||
serviceHostMock.Verify(x => x.SendEvent(FileBrowserExpandedNotification.Type,
|
||||
It.Is<FileBrowserExpandedParams>(p => p.Succeeded == true
|
||||
&& p.ExpandedNode != null
|
||||
&& p.ExpandedNode.Children != null
|
||||
&& p.ExpandedNode.Children.Count > 0)),
|
||||
Times.Once());
|
||||
|
||||
var validateParams = new FileBrowserValidateParams
|
||||
@@ -302,7 +304,7 @@ CREATE CERTIFICATE {1} WITH SUBJECT = 'Backup Encryption Certificate'; ";
|
||||
await service.RunFileBrowserValidateTask(validateParams);
|
||||
|
||||
// Verify complete notification event was fired and the result
|
||||
serviceHostMock.Verify(x => x.SendEvent(FileBrowserValidateCompleteNotification.Type, It.Is<FileBrowserValidateCompleteParams>(p => p.Succeeded == true)), Times.Once());
|
||||
serviceHostMock.Verify(x => x.SendEvent(FileBrowserValidatedNotification.Type, It.Is<FileBrowserValidatedParams>(p => p.Succeeded == true)), Times.Once());
|
||||
|
||||
// Remove the backup file
|
||||
if (File.Exists(backupPath))
|
||||
|
||||
Reference in New Issue
Block a user