コード例 #1
0
        private PrinterTabViewModel BuildViewModel(IList <ConversionProfile> profiles = null)
        {
            var settings = new PdfCreatorSettings(null);

            settings.ApplicationSettings = _applicationSettings;
            settings.ConversionProfiles.Add(new ConversionProfile());

            var printerHelper = Substitute.For <IPrinterHelper>();

            printerHelper.GetApplicablePDFCreatorPrinter(Arg.Any <string>(), Arg.Any <string>()).Returns("PDFCreator");

            if (profiles != null)
            {
                settings.ConversionProfiles = profiles;
            }

            var viewModel = new PrinterTabViewModel(_printerProvider, new TranslationProxy(), _printerActionAssistant, null, null, printerHelper);

            viewModel.SetSettingsAndRaiseNotifications(settings, null);

            return(viewModel);
        }