Beispiel #1
0
        public void RunJob_InitializesProcessorBeforeConversion()
        {
            var jobRunner = BuildJobRunner();
            var job       = BuildJob();

            var isInitialized = false;

            _pdfProcessor.When(x => x.Init(job)).Do(x => { isInitialized = true; });

            _converter.When(x => x.DoConversion(job)).Do(x =>
            {
                if (!isInitialized)
                {
                    throw new Exception();
                }
            });

            jobRunner.RunJob(job, _outputFileMover);

            _converter.Received().DoConversion(job);
        }