public void Setup()
        {
            _kaveSettings    = new KaVESettings();
            _anonSettings    = new AnonymizationSettings();
            _profileSettings = new UserProfileSettings();
            _exportSettings  = new ExportSettings();
            _profileUtils    = Mock.Of <IUserProfileSettingsUtils>();

            _store = Mock.Of <ISettingsStore>();
            Mock.Get(_store).Setup(ss => ss.GetSettings <KaVESettings>()).Returns(_kaveSettings);
            Mock.Get(_store).Setup(s => s.GetSettings <AnonymizationSettings>()).Returns(_anonSettings);
            Mock.Get(_store).Setup(s => s.GetSettings <UserProfileSettings>()).Returns(_profileSettings);
            Mock.Get(_store).Setup(s => s.GetSettings <ExportSettings>()).Returns(_exportSettings);

            _windows = Mock.Of <ISimpleWindowOpener>();

            // setting valid values that should not be notified
            _anonSettings.RemoveSessionIDs = false;
            _profileSettings.ProfileId     = "x";
            _exportSettings.UploadUrl      = "http://upload.kave.cc/";
        }
示例#2
0
        public FirstStartNotificator(ISimpleWindowOpener windows,
                                     ISettingsStore ss,
                                     IUserProfileSettingsUtils profileUtils)
        {
            _settingsStore = ss;
            _profileUtils  = profileUtils;
            _windows       = windows;

            var s = _settingsStore.GetSettings <KaVESettings>();

            if (s.IsFirstStart)
            {
                s.IsFirstStart = false;
                _settingsStore.SetSettings(s);

                _windows.OpenFirstStartWindow();
                Assert(false);
            }
            else
            {
                Assert(true);
            }
        }