public void VisitWebsiteExecute_ProcessStarterGetsCalled()
        {
            var wasCalled = false;
            var viewModel = BuildViewModel();

            _processStarter.When(x => x.Start(viewModel.PdfforgeWebsiteUrl)).Do(x => wasCalled = true);

            viewModel.VisitWebsiteCommand.Execute(null);
            Assert.IsTrue(wasCalled);
        }
Ejemplo n.º 2
0
        public void Execute_CommandIsNotInitializedTransmittedParmeterIsNull_DoesNotThrowException()
        {
            _urlOpenCommand.Execute(null);
            _processStarter.When(x => x.Start(Arg.Any <string>())).Do(x => { throw new Exception(); });

            Assert.DoesNotThrow(() => { _urlOpenCommand.Execute(null); });
        }
        public void ThrowErrorOnProcessStart_StartProcesViaManageLicensesCommand_CaptureError()
        {
            var viewModel = BuildViewModel();

            _process.When(starter => starter
                          .Start(Arg.Any <string>()))
            .Do(x => { throw new Exception("Should be Caught"); });

            Assert.DoesNotThrow(() => viewModel.ManageLicensesCommand.Execute(null));
        }