public void SetUp()
        {
            _interactionRequest = new UnitTestInteractionRequest();
            var fileWrap = Substitute.For <IFile>();
            var openFileInteractionHelper = Substitute.For <IOpenFileInteractionHelper>();
            var editionHintOptionProvider = new EditionHintOptionProvider(false, false);
            var translationUpdater        = new TranslationUpdater(new TranslationFactory(null), new ThreadManager());
            var settingsProvider          = Substitute.For <ICurrentSettingsProvider>();

            var settings = new PdfCreatorSettings(null);

            _timeServerAccounts = new ObservableCollection <TimeServerAccount>();
            settings.ApplicationSettings.Accounts.TimeServerAccounts = _timeServerAccounts;
            settingsProvider.Settings.Returns(settings);

            var commandLocator = Substitute.For <ICommandLocator>();

            commandLocator = Substitute.For <ICommandLocator>();
            commandLocator.GetMacroCommand().Returns(x => new MacroCommand(commandLocator));

            _timeServerAddCommand = Substitute.For <ICommand>();
            commandLocator.GetCommand <TimeServerAccountAddCommand>().Returns(_timeServerAddCommand);

            _timeServerEditCommand = Substitute.For <ICommand>();
            commandLocator.GetCommand <TimeServerAccountEditCommand>().Returns(_timeServerEditCommand);

            _viewModel = new SignUserControlViewModel(_interactionRequest, fileWrap, openFileInteractionHelper,
                                                      editionHintOptionProvider, translationUpdater, settingsProvider,
                                                      settingsProvider, commandLocator);
        }
        public void Setup()
        {
            _settings           = new PdfCreatorSettings(null);
            _jobInfoQueue       = Substitute.For <IJobInfoQueue>();
            _profileChecker     = Substitute.For <IProfileChecker>();
            _interactionRequest = new UnitTestInteractionRequest();
            _file = Substitute.For <IFile>();

            MockSaveFileDialog(true);

            _pdfProfile = new ConversionProfile
            {
                Name             = "PDF Profile",
                OutputFormat     = OutputFormat.Pdf,
                FileNameTemplate = "X:\\test.pdf"
            };

            _pngProfile = new ConversionProfile
            {
                Name             = "PDF Profile",
                OutputFormat     = OutputFormat.Png,
                FileNameTemplate = "X:\\test.png"
            };

            _settings.ConversionProfiles.Add(_pdfProfile);
            _settings.ConversionProfiles.Add(_pngProfile);
        }
Beispiel #3
0
        public void SetUp()
        {
            _interactionRequest = new UnitTestInteractionRequest();

            _smtpTest = Substitute.For <ISmtpTest>();

            var translationUpdater = new TranslationUpdater(new TranslationFactory(), new ThreadManager());

            _profile = new ConversionProfile();
            var currentSettingsProvider = Substitute.For <ICurrentSettingsProvider>();

            currentSettingsProvider.SelectedProfile.Returns(_profile);

            var settings = new PdfCreatorSettings(null);

            _smtpAccounts = new ObservableCollection <SmtpAccount>();
            settings.ApplicationSettings.Accounts.SmtpAccounts = _smtpAccounts;
            currentSettingsProvider.Settings.Returns(settings);

            var commandLocator = Substitute.For <ICommandLocator>();

            commandLocator = Substitute.For <ICommandLocator>();
            commandLocator.GetMacroCommand().Returns(x => new MacroCommand(commandLocator));

            _addCommand = Substitute.For <ICommand>();
            commandLocator.GetCommand <SmtpAccountAddCommand>().Returns(_addCommand);
            _editCommand = Substitute.For <ICommand>();
            commandLocator.GetCommand <SmtpAccountEditCommand>().Returns(_editCommand);

            _tokenHelper   = new TokenHelper(new DesignTimeTranslationUpdater());
            _tokenReplacer = _tokenHelper.TokenReplacerWithPlaceHolders;

            _viewModel = new SmtpActionViewModel(_interactionRequest, _smtpTest, translationUpdater, currentSettingsProvider, commandLocator, _tokenHelper);
        }
Beispiel #4
0
        public void Setup()
        {
            _settings           = new PdfCreatorSettings(null);
            _jobInfoQueue       = Substitute.For <IJobInfoQueue>();
            _interactionRequest = new UnitTestInteractionRequest();
            _file                      = Substitute.For <IFile>();
            _directoryHelper           = Substitute.For <IDirectoryHelper>();
            _interactiveProfileChecker = Substitute.For <IInteractiveProfileChecker>();

            _pdfProfile = new ConversionProfile
            {
                Name             = "PDF Profile",
                OutputFormat     = OutputFormat.Pdf,
                FileNameTemplate = "X:\\test.pdf",
                TargetDirectory  = "c:\\Test\\"
            };

            _pngProfile = new ConversionProfile
            {
                Name             = "PDF Profile",
                OutputFormat     = OutputFormat.Png,
                FileNameTemplate = "X:\\test.png",
                TargetDirectory  = "c:\\Test\\"
            };

            _settings.ConversionProfiles.Add(_pdfProfile);
            _settings.ConversionProfiles.Add(_pngProfile);
        }
        public void Setup()
        {
            _smtpTestAccount           = new SmtpAccount();
            _smtpTestAccount.AccountId = "SmtpTestAccountId";

            _profile = new ConversionProfile();
            //Attention
            _profile.EmailSmtpSettings.AccountId = _smtpTestAccount.AccountId;
            //The AccountAssosiation is mocked below. The _smtpTestAccount is always used.

            _accounts = new Accounts();
            _accounts.SmtpAccounts.Add(_smtpTestAccount);

            _interactionRequest = new UnitTestInteractionRequest();
            _interactionInvoker = Substitute.For <IInteractionInvoker>();
            _interactionInvoker.Invoke(Arg.Do <PasswordOverlayInteraction>(i => i.Result = PasswordResult.StorePassword));

            _interactionRequest.RegisterInteractionHandler <PasswordOverlayInteraction>(interaction => interaction.Result = PasswordResult.StorePassword);

            _file       = Substitute.For <IFile>();
            _path       = Substitute.For <IPath>();
            _smtpAction = Substitute.For <ISmtpMailAction>();
            _smtpAction.Check(Arg.Any <ConversionProfile>(), _accounts, Arg.Any <CheckLevel>()).Returns(x => new ActionResult());
            _smtpAction.ProcessJob(Arg.Any <Job>()).Returns(x => new ActionResult());
            //_smtpAction.GetSmtpAccount(_profile, _accounts).Returns(_smtpTestAccount);

            _mailSignatureHelper = Substitute.For <IMailSignatureHelper>();
            _mailSignatureHelper.ComposeMailSignature().Returns(_mailSignature);

            _tokenReplacer        = new TokenReplacer();
            _tokenReplacerFactory = Substitute.For <ITokenReplacerFactory>();
            _tokenReplacerFactory.BuildTokenReplacerWithOutputfiles(Arg.Any <Job>()).Returns(_tokenReplacer);

            _translation = new SmtpTranslation();
        }
        public void SetUp()
        {
            _interactionRequest      = new UnitTestInteractionRequest();
            _tabSwitchSettingsCheck  = Substitute.For <ITabSwitchSettingsCheck>();
            _currentSettingsProvider = Substitute.For <ICurrentSettingsProvider>();

            _beforeEvaluateTabSwitchCommand = new EvaluateTabSwitchRelevantSettingsAndNotifyUserCommand(
                _interactionRequest, new DesignTimeTranslationUpdater(), _tabSwitchSettingsCheck, _currentSettingsProvider);

            _commandTester = new WaitableCommandTester <EvaluateTabSwitchRelevantSettingsAndNotifyUserCommand>(_beforeEvaluateTabSwitchCommand);
        }
Beispiel #7
0
        public void SetUp()
        {
            _interactionRequest = new UnitTestInteractionRequest();

            _tabSwitchSettingsCheck = Substitute.For <ITabSwitchSettingsCheck>();

            _evaluateSavingCommand = new EvaluateSavingRelevantSettingsAndNotifyUserCommand(
                _interactionRequest, new DesignTimeTranslationUpdater(), _tabSwitchSettingsCheck);

            _commandTester = new WaitableCommandTester <EvaluateSavingRelevantSettingsAndNotifyUserCommand>(_evaluateSavingCommand);
        }
Beispiel #8
0
        public void Setup()
        {
            _osHelper     = Substitute.For <IOsHelper>();
            _uacAssistant = Substitute.For <IUacAssistant>();
            var applicationNameProvider = new ApplicationNameProvider(EditionName);

            _interactionRequest = new UnitTestInteractionRequest();
            _storeLicenseForAllUsersWindowViewModel = new StoreLicenseForAllUsersWindowViewModel(applicationNameProvider, _osHelper, _uacAssistant, _interactionRequest, new DesignTimeTranslationUpdater());
            var interaction = new StoreLicenseForAllUsersInteraction("", "");

            _interactionHelper = new InteractionHelper <StoreLicenseForAllUsersInteraction>(_storeLicenseForAllUsersWindowViewModel, interaction);
        }
        public void Setup()
        {
            _savedActivation = null;
            //_expectedLicenseKey = null;
            _activationFromServer = null;

            _process        = Substitute.For <IProcessStarter>();
            _licenseChecker = Substitute.For <ILicenseChecker>();
            _licenseChecker.GetSavedActivation().Returns(x => _savedActivation.SomeNotNull(LicenseError.NoActivation));
            _licenseChecker.ActivateWithoutSaving(Arg.Any <string>()).Returns(key => _activationFromServer.SomeNotNull(LicenseError.NoActivation));
            _interactionRequest = new UnitTestInteractionRequest();
        }
        public void Setup()
        {
            _settingsProvider = Substitute.For <ICurrentSettingsProvider>();
            _settings         = new PdfCreatorSettings(null);
            _settingsProvider.Settings.Returns(_settings);
            _applicationSettings                  = new ApplicationSettings();
            _settings.ApplicationSettings         = _applicationSettings;
            _titleReplacements                    = new ObservableCollection <TitleReplacement>();
            _applicationSettings.TitleReplacement = _titleReplacements;

            _interactionRequest = new UnitTestInteractionRequest();

            _command = new TitleReplacementAddCommand(_interactionRequest, _settingsProvider);
        }
        private CheckProfileCommand BuildCommand()
        {
            var settings = new PdfCreatorSettings(null);

            _interactionRequest = new UnitTestInteractionRequest();

            var currentSettingsProvider = Substitute.For <ICurrentSettingsProvider>();

            currentSettingsProvider.Settings.Returns(settings);
            currentSettingsProvider.Profiles.Returns(settings.ConversionProfiles);
            currentSettingsProvider.SelectedProfile.Returns(settings.ConversionProfiles.FirstOrDefault());

            return(new CheckProfileCommand(_profileChecker, currentSettingsProvider, _interactionRequest, new ErrorCodeInterpreter(new TranslationFactory())));
        }
Beispiel #12
0
        public void SetUp()
        {
            _interactionRequest      = new UnitTestInteractionRequest();
            _currentSettingsProvider = Substitute.For <ICurrentSettingsProvider>();
            _currentName             = "current profile name";
            var currentProfile = new ConversionProfile();

            currentProfile.Name = _currentName;
            _currentSettingsProvider.SelectedProfile = currentProfile;

            _translation = new ProfileMangementTranslation();

            _profileRenameCommand = new ProfileRenameCommand(_interactionRequest, _currentSettingsProvider, new DesignTimeTranslationUpdater(), new InvokeImmediatelyDispatcher());
        }
        public void SetUp()
        {
            _profileChecker = Substitute.For <IProfileChecker>();
            var translationFactory = new TranslationFactory();

            _interactionRequest = new UnitTestInteractionRequest();
            _interactionInvoker = Substitute.For <IInteractionInvoker>();

            _interactiveProfileChecker = new InteractiveProfileChecker(_profileChecker, _interactionRequest, _interactionInvoker, translationFactory);

            _job = new Job(null, new ConversionProfile {
                Name = ProfileName
            }, null, null);
        }
        public void SetUp()
        {
            _interactionRequest = new UnitTestInteractionRequest();

            _httpAccounts = new ObservableCollection <HttpAccount>();
            var settings = new PdfCreatorSettings();

            settings.ApplicationSettings.Accounts.HttpAccounts = _httpAccounts;
            _accountsProvider = Substitute.For <ICurrentSettings <Accounts> >();
            _accountsProvider.Settings.Returns(settings.ApplicationSettings.Accounts);

            var translationUpdater = new TranslationUpdater(new TranslationFactory(), new ThreadManager());

            _httpAccountAddCommand = new HttpAccountAddCommand(_interactionRequest, _accountsProvider, translationUpdater);
        }
        public void SetUp()
        {
            _interactionRequest = new UnitTestInteractionRequest();
            _translation        = new DropboxTranslation();

            _dropboxAccounts = new ObservableCollection <DropboxAccount>();

            _usedAccount             = new DropboxAccount();
            _usedAccount.AccountId   = nameof(_usedAccount);
            _usedAccount.AccountInfo = "AI1";
            _usedAccount.AccessToken = "AT1";
            _dropboxAccounts.Add(_usedAccount);

            _unusedAccount             = new DropboxAccount();
            _unusedAccount.AccountId   = nameof(_unusedAccount);
            _unusedAccount.AccountInfo = "AI2";
            _unusedAccount.AccessToken = "AT2";
            _dropboxAccounts.Add(_unusedAccount);

            _profilesProvider = Substitute.For <ICurrentSettings <ObservableCollection <ConversionProfile> > >();
            _profiles         = new ObservableCollection <ConversionProfile>();

            _profileWithDropboxActionEnabled      = new ConversionProfile();
            _profileWithDropboxActionEnabled.Name = nameof(_profileWithDropboxActionEnabled);
            _profileWithDropboxActionEnabled.DropboxSettings.Enabled   = true;
            _profileWithDropboxActionEnabled.DropboxSettings.AccountId = _usedAccount.AccountId;
            _profiles.Add(_profileWithDropboxActionEnabled);

            _profileWithDropboxActionDisabled      = new ConversionProfile();
            _profileWithDropboxActionDisabled.Name = nameof(_profileWithDropboxActionDisabled);
            _profileWithDropboxActionDisabled.DropboxSettings.Enabled   = false;
            _profileWithDropboxActionDisabled.DropboxSettings.AccountId = _usedAccount.AccountId;
            _profiles.Add(_profileWithDropboxActionDisabled);

            var settings = new PdfCreatorSettings();

            settings.ApplicationSettings.Accounts.DropboxAccounts = _dropboxAccounts;
            settings.ConversionProfiles = _profiles;
            _accountsProvider           = Substitute.For <ICurrentSettings <Accounts> >();
            _accountsProvider.Settings.Returns(settings.ApplicationSettings.Accounts);
            _profilesProvider.Settings.Returns(_profiles);

            var translationUpdater = new TranslationUpdater(new TranslationFactory(), new ThreadManager());

            _dropboxService = Substitute.For <IDropboxService>();

            _dropboxAccountRemoveCommand = new DropboxAccountRemoveCommand(_interactionRequest, _accountsProvider, _profilesProvider, _dropboxService, translationUpdater);
        }
        public void SetUp()
        {
            _file = Substitute.For <IFile>();
            _file.Exists(Arg.Any <string>()).Returns(true);

            _unitTestInteractionRequest = new UnitTestInteractionRequest();
            var translationUpdater = new DesignTimeTranslationUpdater();

            _deleteHistoricFilesCommand = new DeleteHistoricFilesCommand(_file, _unitTestInteractionRequest, translationUpdater);

            _translation = new DeleteFilesTranslation();

            _historicFiles = new List <HistoricFile> {
                new HistoricFile(File1, "", "", ""), new HistoricFile(File2, "", "", "")
            };
        }
Beispiel #17
0
        public void SetUp()
        {
            _interactionRequest                      = new UnitTestInteractionRequest();
            _currentSettingsProvider                 = Substitute.For <ICurrentSettingsProvider>();
            _presentProfile                          = new ConversionProfile();
            _presentProfile.AuthorTemplate           = "Example settings to check copied profile later";
            _currentSettingsProvider.SelectedProfile = _presentProfile;
            _settings = new PdfCreatorSettings(null);
            _settings.ConversionProfiles.Add(_presentProfile);
            _currentSettingsProvider.Settings.Returns(_settings);
            _currentSettingsProvider.Profiles.Returns(_settings.ConversionProfiles);

            _translation = new ProfileMangementTranslation();

            _profileAddCommand = new ProfileAddCommand(_interactionRequest, _currentSettingsProvider, new DesignTimeTranslationUpdater());
        }
        public void SetUp()
        {
            _interactionRequest = new UnitTestInteractionRequest();
            _translation        = new FtpActionTranslation();

            _ftpAccounts = new ObservableCollection <FtpAccount>();

            _profilesProvider = Substitute.For <ICurrentSettings <ObservableCollection <ConversionProfile> > >();

            _usedAccount           = new FtpAccount();
            _usedAccount.AccountId = nameof(_usedAccount);
            _usedAccount.UserName  = "******";
            _usedAccount.Server    = "SV1";
            _ftpAccounts.Add(_usedAccount);

            _unusedAccount           = new FtpAccount();
            _unusedAccount.AccountId = nameof(_unusedAccount);
            _unusedAccount.UserName  = "******";
            _unusedAccount.Server    = "SV2";
            _ftpAccounts.Add(_unusedAccount);

            _profiles = new ObservableCollection <ConversionProfile>();

            _profileWithFtpAccountEnabled               = new ConversionProfile();
            _profileWithFtpAccountEnabled.Name          = nameof(_profileWithFtpAccountEnabled);
            _profileWithFtpAccountEnabled.Ftp.Enabled   = true;
            _profileWithFtpAccountEnabled.Ftp.AccountId = _usedAccount.AccountId;
            _profiles.Add(_profileWithFtpAccountEnabled);

            _profileWithFtpAccountDisabled               = new ConversionProfile();
            _profileWithFtpAccountDisabled.Name          = nameof(_profileWithFtpAccountDisabled);
            _profileWithFtpAccountDisabled.Ftp.Enabled   = false;
            _profileWithFtpAccountDisabled.Ftp.AccountId = _usedAccount.AccountId;
            _profiles.Add(_profileWithFtpAccountDisabled);

            var settings = new PdfCreatorSettings();

            settings.ApplicationSettings.Accounts.FtpAccounts = _ftpAccounts;
            settings.ConversionProfiles = _profiles;
            _accountsProvider           = Substitute.For <ICurrentSettings <Accounts> >();
            _accountsProvider.Settings.Returns(settings.ApplicationSettings.Accounts);
            _profilesProvider.Settings.Returns(_profiles);

            var translationUpdater = new TranslationUpdater(new TranslationFactory(), new ThreadManager());

            _ftpAccountRemoveCommand = new FtpAccountRemoveCommand(_interactionRequest, _accountsProvider, _profilesProvider, translationUpdater);
        }
        public void SetUp()
        {
            _interactionRequest = new UnitTestInteractionRequest();

            _ftpAccounts = new ObservableCollection <FtpAccount>();
            var settings = new PdfCreatorSettings(null);

            settings.ApplicationSettings.Accounts.FtpAccounts = _ftpAccounts;
            var currentSettingsProvider = Substitute.For <ICurrentSettingsProvider>();

            currentSettingsProvider.Settings.Returns(settings);

            _translation = new FtpActionTranslation();
            var translationUpdater = new TranslationUpdater(new TranslationFactory(), new ThreadManager());

            _ftpAccountAddCommand = new FtpAccountAddCommand(_interactionRequest, currentSettingsProvider, translationUpdater);
        }
        public void SetUp()
        {
            _interactionRequest      = new UnitTestInteractionRequest();
            _currentSettingsProvider = Substitute.For <ICurrentSettingsProvider>();
            _currentProfile          = new ConversionProfile();
            _currentProfile.Name     = "CurrentProfileName";
            _currentSettingsProvider.SelectedProfile = _currentProfile;
            _settings = new PdfCreatorSettings(null);
            _settings.ConversionProfiles.Add(_currentProfile);
            _settings.ConversionProfiles.Add(new ConversionProfile());
            _currentSettingsProvider.Settings.Returns(_settings);
            _currentSettingsProvider.Profiles.Returns(_settings.ConversionProfiles);

            _translation = new ProfileMangementTranslation();

            _profileRemoveCommand = new ProfileRemoveCommand(_interactionRequest, _currentSettingsProvider, new DesignTimeTranslationUpdater(), new InvokeImmediatelyDispatcher());
        }
Beispiel #21
0
        public void SetUp()
        {
            _interactionRequest = new UnitTestInteractionRequest();
            _translation        = new HttpTranslation();

            _httpAccounts = new ObservableCollection <HttpAccount>();

            _usedAccount           = new HttpAccount();
            _usedAccount.AccountId = nameof(_usedAccount);
            _usedAccount.Url       = "www.pdfforge1.org";
            _usedAccount.UserName  = "******";
            _httpAccounts.Add(_usedAccount);

            _unusedAccount           = new HttpAccount();
            _unusedAccount.AccountId = nameof(_unusedAccount);
            _unusedAccount.Url       = "www.pdfforge2.org";
            _unusedAccount.UserName  = "******";
            _httpAccounts.Add(_unusedAccount);

            _profiles = new ObservableCollection <ConversionProfile>();

            _profileWithHttpAccountEnabled      = new ConversionProfile();
            _profileWithHttpAccountEnabled.Name = nameof(_profileWithHttpAccountEnabled);
            _profileWithHttpAccountEnabled.HttpSettings.Enabled   = true;
            _profileWithHttpAccountEnabled.HttpSettings.AccountId = _usedAccount.AccountId;
            _profiles.Add(_profileWithHttpAccountEnabled);

            _profileWithHttpAccountDisabled      = new ConversionProfile();
            _profileWithHttpAccountDisabled.Name = nameof(_profileWithHttpAccountDisabled);
            _profileWithHttpAccountDisabled.HttpSettings.Enabled   = false;
            _profileWithHttpAccountDisabled.HttpSettings.AccountId = _usedAccount.AccountId;
            _profiles.Add(_profileWithHttpAccountDisabled);

            var settings = new PdfCreatorSettings(null);

            settings.ApplicationSettings.Accounts.HttpAccounts = _httpAccounts;
            settings.ConversionProfiles = _profiles;
            var currentSettingsProvider = Substitute.For <ICurrentSettingsProvider>();

            currentSettingsProvider.Settings.Returns(settings);
            currentSettingsProvider.Profiles.Returns(_profiles);

            var translationUpdater = new TranslationUpdater(new TranslationFactory(), new ThreadManager());

            _httpAccountRemoveCommand = new HttpAccountRemoveCommand(_interactionRequest, currentSettingsProvider, translationUpdater);
        }
        public void SetUp()
        {
            _interactionRequest = new UnitTestInteractionRequest();

            _mailClientTest = Substitute.For <IClientTestEmail>();

            var translationUpdater = new TranslationUpdater(new TranslationFactory(), new ThreadManager());

            _profile = new ConversionProfile();
            var currentSettingsProvider = Substitute.For <ICurrentSettingsProvider>();

            currentSettingsProvider.SelectedProfile.Returns(_profile);

            _tokenHelper   = new TokenHelper(new DesignTimeTranslationUpdater());
            _tokenReplacer = _tokenHelper.TokenReplacerWithPlaceHolders;

            _viewModel = new MailClientControlViewModel(_interactionRequest, _mailClientTest, translationUpdater, currentSettingsProvider, new TokenViewModelFactory(currentSettingsProvider, new TokenHelper(new DesignTimeTranslationUpdater())), null);
        }
Beispiel #23
0
        public void SetUp()
        {
            _interactionRequest         = new UnitTestInteractionRequest();
            _currentFtpAccount          = new FtpAccount();
            _currentFtpAccount.UserName = "******";
            _ftpAccounts = new ObservableCollection <FtpAccount>();
            _ftpAccounts.Add(_currentFtpAccount);
            var settings = new PdfCreatorSettings();

            settings.ApplicationSettings.Accounts.FtpAccounts = _ftpAccounts;
            _accountsProvider = Substitute.For <ICurrentSettings <Accounts> >();
            _accountsProvider.Settings.Returns(settings.ApplicationSettings.Accounts);

            _translation = new FtpActionTranslation();
            var translationUpdater = new TranslationUpdater(new TranslationFactory(), new ThreadManager());

            _ftpAccountEditCommand = new FtpAccountEditCommand(_interactionRequest, _accountsProvider, translationUpdater);
        }
Beispiel #24
0
        public void Setup()
        {
            if (Debugger.IsAttached)
            {
                _timeout = TimeSpan.FromMinutes(5);
            }

            _savedActivation      = null;
            _expectedLicenseKey   = null;
            _activationFromServer = null;

            _process        = Substitute.For <IProcessStarter>();
            _licenseChecker = Substitute.For <ILicenseChecker>();
            _licenseChecker.GetSavedActivation().Returns(x => _savedActivation.SomeNotNull(LicenseError.NoActivation));
            _licenseChecker.ActivateWithoutSaving(Arg.Any <string>()).Returns(key => _activationFromServer.SomeNotNull(LicenseError.NoActivation));
            _offlineActivator   = Substitute.For <IOfflineActivator>();
            _interactionRequest = new UnitTestInteractionRequest();

            _dispatcher = new InvokeImmediatelyDispatcher();
        }
Beispiel #25
0
        public void SetUp()
        {
            _interactionRequest = new UnitTestInteractionRequest();
            _translation        = new HttpTranslation();
            _currentHttpAccount = new HttpAccount()
            {
                UserName = "******"
            };
            _httpAccounts = new ObservableCollection <HttpAccount>();
            _httpAccounts.Add(_currentHttpAccount);
            var settings = new PdfCreatorSettings(null);

            settings.ApplicationSettings.Accounts.HttpAccounts = _httpAccounts;
            var currentSettingsProvider = Substitute.For <ICurrentSettingsProvider>();

            currentSettingsProvider.Settings.Returns(settings);

            var translationUpdater = new TranslationUpdater(new TranslationFactory(), new ThreadManager());

            _httpAccountEditCommand = new HttpAccountEditCommand(_interactionRequest, currentSettingsProvider, translationUpdater);
        }
        public void Setup()
        {
            _interactionRequest = new UnitTestInteractionRequest();

            _settings = new PdfCreatorSettings(null);
            _currentSettingsProvider = Substitute.For <ICurrentSettingsProvider>();
            _currentSettingsProvider.Settings.Returns(_settings);
            _currentSettingsProvider.Profiles.Returns(_settings.ConversionProfiles);
            _currentSettingsProvider.SelectedProfile.Returns(_settings.ConversionProfiles.FirstOrDefault());

            var translationUpdater = new DesignTimeTranslationUpdater();

            _regionHelper = Substitute.For <IRegionHelper>();

            _profileChecker = Substitute.For <IProfileChecker>();
            _profileChecker.CheckProfileList(_settings.ConversionProfiles, _settings.ApplicationSettings.Accounts)
            .Returns(new ActionResultDict());

            _appSettingsChecker = Substitute.For <IAppSettingsChecker>();
            _appSettingsChecker.CheckDefaultViewers(Arg.Any <ApplicationSettings>())
            .Returns(new ActionResult());

            _settingsChanged = Substitute.For <ISettingsChanged>();

            _command = new EvaluateSettingsAndNotifyUserCommand(_interactionRequest, _currentSettingsProvider,
                                                                translationUpdater, _regionHelper, _profileChecker,
                                                                _appSettingsChecker, _settingsChanged);

            _commandTester = new WaitableCommandTester <EvaluateSettingsAndNotifyUserCommand>(_command);

            _translation = new EvaluateSettingsAndNotifyUserTranslation();

            _actionResultWithError = new ActionResult((ErrorCode)123456789);
            _errorsInProfile       = new ActionResultDict();
            _errorsInProfile.Add("Some Profile", _actionResultWithError);
        }