Example #1
0
 public void Setup()
 {
     ViewModelBootstrapperForTests.Initialize();
     viewModel = new Widget();
     configPersisterFake = new Mock<IPersistDomainModelsAsync<Configuration>>();
     controller = new WidgetController(viewModel, configPersisterFake.Object);
     viewModel.SaveSettings.Execute();
 }
Example #2
0
 public WidgetController(Widget viewModel, IPersistDomainModelsAsync<Configuration> configPersister)
 {
     this.viewModel = viewModel;
     viewModel.SaveSettings.ExecuteDelegate = OnSaveSettings;
     this.configPersister = configPersister;
     this.configPersister.SaveCompleted += ConfigPersisterSaveCompleted;
     
 }
 public void Setup()
 {
     ViewModelBootstrapperForTests.Initialize();
     widgetToReturnConfigurationFrom = new Widget();
     persisterMock = new Mock<IPersistDomainModelsAsync<Configuration>>();
     repo = new WidgetConfigurationRepository(widgetToReturnConfigurationFrom, persisterMock.Object);
     before();
 }
Example #4
0
 private void CheckForChangesAndNotify(Configuration latestConfig, Widget registeredWidget)
 {
     if( latestConfig != null )
     {
         if( !ConfigsAreEqual(latestConfig, registeredWidget.Configuration))
         {
             registeredWidget.Configuration = latestConfig;
         }
     }
 }
            public void Setup()
            {
                ViewModelBootstrapperForTests.Initialize();
                timerMock = new Mock<ITimer>();
                configRepoMock = new Mock<IAsyncRepository<Configuration>>(); 
                wasNotified = false;

                registeredWidget = new Widget();
                registeredWidget.ConfigurationChanged += (o, e) => wasNotified = true;
                manager = new ConfigurationManager(timerMock.Object, configRepoMock.Object);

                before();
            }
Example #6
0
            public  void Setup()
            {               
                ViewModelBootstrapperForTests.Initialize();
                viewModel = new Widget();
                configPersisterFake = new Mock<IPersistDomainModelsAsync<Configuration>>();
                controller = new WidgetController(viewModel, configPersisterFake.Object);
                viewModel.SaveSettings.Execute();

                viewModel.Settings.Execute();
                viewModel.SaveSettings.Execute();
                viewModel.Settings.ExecuteDelegate = () => settingsCommandExecuted = true;

                configPersisterFake.Raise(p => p.SaveCompleted += null, new SaveCompletedEventArgs());
            }
Example #7
0
        public void LoadSlides(Slideshow slideshow)
        {
        	Guard.Requires<ArgumentNullException>(slideshow != null);

            slideshowViewModel = slideshow; 
            slideshowViewModel.Slides.Clear();
            welcomeWidget = new WelcomeWidget();
#if SILVERLIGHT
            welcomeWidget.View = new SL.WelcomeWidgetView();
#endif
            slideshowViewModel.Slides.Add(new Slide(){Widget = welcomeWidget});
            welcomeWidget.ProgressbarService.ShowInView("Downloading slideshow configuration...");

			widgetMetadataRepo.BeginGet(All.ItemsOf<WidgetMetadata>());
        }
Example #8
0
 public void RegisterForConfigurationUpdates(Widget widgetToRegister)
 {
     registeredWidgets.Add(widgetToRegister);
     var config = GetConfigForWidget(latestConfigurations, widgetToRegister);
     CheckForChangesAndNotify(config, widgetToRegister);
 }
Example #9
0
 private Configuration GetConfigForWidget(IEnumerable<Configuration> latestConfigurations, Widget registeredWidget)
 {
     return latestConfigurations.SingleOrDefault(c => c.Id == registeredWidget.Configuration.Id);
 }
Example #10
0
		partial void OnSetWidget(ref Widget value);