Ejemplo n.º 1
0
        private void SaveExecute(object obj)
        {
            ChangeOutputFormat(); //Ensure extension before the checks

            if (_interactiveProfileChecker.CheckWithErrorResultInOverlay(_job))
            {
                if (CheckIfFileExistsElseNotifyUser())
                {
                    CallFinishInteraction();
                }
            }
        }
Ejemplo n.º 2
0
        private void SaveExecute(object obj)
        {
            EnsureValidExtensionInFilename(); //Ensure extension before the checks

            if (_interactiveProfileChecker.CheckWithErrorResultInOverlay(Job))
            {
                if (CheckIfFileExistsElseNotifyUser())
                {
                    CallFinishInteraction();
                }
            }
        }
        public async Task SaveCommand_Execute_JobProfileIsValid_Finishes()
        {
            var vm  = BuildViewModel();
            var job = BuildJob(_pdfProfile);

            _interactiveProfileChecker.CheckWithErrorResultInOverlay(job).Returns(true);

            var task = vm.ExecuteWorkflowStep(job);

            vm.SaveCommand.Execute(null);

            await task.TimeoutAfter(TimeSpan.FromMilliseconds(100));
        }
Ejemplo n.º 4
0
        public void SaveCommand_Execute_JobProfileIsValid_CallsFinishedEvent()
        {
            var eventWasRaised = false;
            var vm             = BuildViewModel();
            var job            = BuildJob(_pdfProfile);

            _interactiveProfileChecker.CheckWithErrorResultInOverlay(job).Returns(true);

            vm.StepFinished += (sender, args) => eventWasRaised = true;
            vm.ExecuteWorkflowStep(job);

            vm.SaveCommand.Execute(null);

            Assert.IsTrue(eventWasRaised);
        }
        private async Task <bool> CheckJob(Job job)
        {
            //Ensure extension before the checks
            job.OutputFileTemplate = _outputFormatHelper.EnsureValidExtension(job.OutputFileTemplate, job.Profile.OutputFormat);

            if (!_interactiveProfileChecker.CheckWithErrorResultInOverlay(job))
            {
                return(false);
            }

            var fileExistsResult = await _interactiveFileExistsChecker.CheckIfFileExistsWithResultInOverlay(job, _getLatestConfirmedPath());

            _setLatestConfirmedPath(fileExistsResult.ConfirmedPath);
            return(fileExistsResult.Success);
        }