Ejemplo n.º 1
0
        public void SettingsAreLoadedIntoGlobalUserPreferencesWhenClosingDialogue()
        {
            // Arrange

            var repository        = Mock.Of <IUserPreferencesModelRepository>();
            var globalPreferences = Mock.Of <IUserPreferences>();
            var initializer       = new ViewModelServiceInitializer();

            var service = initializer.InitializeViewModelService(
                userPreferences: globalPreferences,
                userPreferencesModelRepository: repository);

            var optionsPage = new TestingOptionsPage();

            // Act

            optionsPage.SimulateClose();

            // Assert

            Mock.Get(repository).Verify(r =>
                                        r.LoadInto(globalPreferences));
        }
Ejemplo n.º 2
0
        public void SettingsAreLoadedIntoDialogueIfDialogueIsActivatedAfterClosing()
        {
            // Arrange

            var repository  = Mock.Of <IUserPreferencesModelRepository>();
            var initializer = new ViewModelServiceInitializer();

            var service = initializer.InitializeViewModelService(
                userPreferencesModelRepository: repository);

            var optionsPage = new TestingOptionsPage();

            optionsPage.SimulateClose();

            // Act

            optionsPage.SimulateActivate();

            // Assert

            Mock.Get(repository).Verify(r =>
                                        r.LoadInto(It.IsAny <UserPreferencesModel>()));
        }