public async Task SaveCommand_Execute_ProfileIsValid_FilePathNotFromSaveDialog_FileExist_NotifysUser_UserCancels_DoNotCallFinish() { var vm = BuildViewModel(); var job = BuildJob(_pdfProfile); var task = vm.ExecuteWorkflowStep(job); _interactionRequest.Raise(Arg.Do <MessageInteraction>(i => i.Response = MessageResponse.No)); //User cancels await vm.BrowseFileCommandAsync.ExecuteAsync(null); _file.Exists(Arg.Any <string>()).Returns(true); vm.OutputFilename = "not" + _filenameFromSaveDialog; vm.OutputFolder = "not" + _folderFromSaveDialog; vm.SaveCommand.Execute(null); Assert.IsFalse(task.IsCompleted); await AbortStep(vm, task); }
public void SaveCommand_Execute_ProfileIsValid_FilePathNotFromSaveDialog_FileExist_NotifysUser_UserCancels_DoNotCallFinishEvent() { var vm = BuildViewModel(); var job = BuildJob(_pdfProfile); vm.ExecuteWorkflowStep(job); var stepFinishedRaised = false; vm.StepFinished += (sender, args) => stepFinishedRaised = true; _interactionRequest.Raise(Arg.Do <MessageInteraction>(i => i.Response = MessageResponse.No)); //User cancels vm.BrowseFileCommand.Execute(null); _file.Exists(Arg.Any <string>()).Returns(true); vm.OutputFilename = "not" + _filenameFromSaveDialog; vm.OutputFolder = "not" + _folderFromSaveDialog; vm.SaveCommand.Execute(null); Assert.IsFalse(stepFinishedRaised); }