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:
Kate Shin
2017-09-28 13:02:57 -07:00
committed by GitHub
parent 3510ad7d5c
commit b46c4b4381
8 changed files with 53 additions and 35 deletions

View File

@@ -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))