private void AskForApplicationPath(ApplicationNotFoundEventArgs args) { var message = text.Get(TextKey.FolderDialog_ApplicationLocation).Replace("%%NAME%%", args.DisplayName).Replace("%%EXECUTABLE%%", args.ExecutableName); var result = fileSystemDialog.Show(FileSystemElement.Folder, FileSystemOperation.Open, message: message, parent: splashScreen); if (result.Success) { args.CustomPath = result.FullPath; args.Success = true; } }
public void Operations_MustAbortAskingForApplicationPath() { var args = new ApplicationNotFoundEventArgs(default(string), default(string)); var result = new FileSystemDialogResult { Success = false }; fileSystemDialog.Setup(d => d.Show( It.IsAny <FileSystemElement>(), It.IsAny <FileSystemOperation>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <IWindow>())).Returns(result); text.SetReturnsDefault(string.Empty); sut.TryStart(); operationSequence.Raise(s => s.ActionRequired += null, args); Assert.IsNull(args.CustomPath); Assert.IsFalse(args.Success); }
public void Operations_MustAskForApplicationPath() { var args = new ApplicationNotFoundEventArgs(default(string), default(string)); var result = new FileSystemDialogResult { FullPath = @"C:\Some\random\path\", Success = true }; fileSystemDialog.Setup(d => d.Show( It.IsAny <FileSystemElement>(), It.IsAny <FileSystemOperation>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <IWindow>())).Returns(result); text.SetReturnsDefault(string.Empty); sut.TryStart(); operationSequence.Raise(s => s.ActionRequired += null, args); Assert.AreEqual(result.FullPath, args.CustomPath); Assert.IsTrue(args.Success); }