public WorkingDaysLeftController(
            WorkingDaysLeftViewModel leftViewModel,
            WorkingDaysLeftSettingsViewModel settingsViewModel,
            IAsyncRepository<ProjectInfoServer> projectInforepository,
            IAsyncRepository<Holiday> holidayRepository,
            ITimer refreshNotifier,
            ILog logger,
            IProgressbar loadingNotifier,
            Configuration config)
        {
            this.leftViewModel = leftViewModel;
            this.settingsViewModel = settingsViewModel;
            this.holidayRepository = holidayRepository;
            this.projectInforepository = projectInforepository;
            this.logger = logger;
            this.loadingNotifier = loadingNotifier;
            this.refreshNotifier = refreshNotifier;

            this.Rand = new Random((int)DateTime.Now.Ticks).Next();

            projectInforepository.GetCompleted += GotProjectInfo;
            holidayRepository.GetCompleted += GotHolidays;

            this.settingsViewModel.RefreshAvailableServers.ExecuteDelegate = OnRefreshAvailableServers;
            this.settingsViewModel.ReloadSettings.ExecuteDelegate = settingsViewModel.Reset;

            refreshNotifier.Elapsed += refreshNotifier_Elapsed;
            settingsViewModel.PropertyChanged += RefreshAvailableProjectsWhenSelectedServerChanges;
            refreshNotifier.Start(10000);

            OnRefreshAvailableServers();
            SetConfigAndUpdate(config);
        }
        protected static void CreateController()
        {
			RemoveAllGlobalDependencies.ForAllViewModels();
			ConfigureGlobalDependencies.ForAllViewModels(config =>
				config.Bind<IUIInvoker>().To<UIInvokerForTesting>());

            _workingDaysLeftViewModel = new WorkingDaysLeftViewModel();
            _workingDaysLeftSettingsViewModel = new WorkingDaysLeftSettingsViewModel();
            _controller = new WorkingDaysLeftRxController(
                _workingDaysLeftViewModel,
                _workingDaysLeftSettingsViewModel,
                projectRepositoryMock.Object,
                configRepositoryMock.Object,
                holidayRepositoryMock.Object,
                configPersisterRepositoryMock.Object,
                _iTimerMock.Object,
                loggerMock.Object
                );
        }
        public WorkingDaysLeftRxController(
            WorkingDaysLeftViewModel viewModel, 
            WorkingDaysLeftSettingsViewModel settingsViewModel,
            IAsyncRepository<ProjectInfoServer> projectInforepository,
            IAsyncRepository<Configuration> configRepository,
            IAsyncRepository<Holiday> holidayRepository, 
            IPersistDomainModels<Configuration> configPersisterRepository,
            ITimer refreshNotifier,
            ILog logger)
        {
            _viewModel = viewModel;
            _settingsViewModel = settingsViewModel;
            this._holidayRepository = holidayRepository;
            this._projectInforepository = projectInforepository;
            this._logger = logger;
            this._configRepository = configRepository;
            this._configPersisterRepository = configPersisterRepository;

            SetupReactiveEvents();
        }
 public void Setup()
 {
     var noHolidays = new List<Holiday>();
     _viewModel = new WorkingDaysLeftViewModel();
     _viewModel.Holidays = noHolidays;
 }
 public void Setup()
 {
     _viewModel = new WorkingDaysLeftViewModel();
 }
Example #6
0
 public void SetUp()
 {
     config = new Configuration{ IsConfigured = true };
     loadingNotifierMock = new Mock<IProgressbar>();
     viewModel = new WorkingDaysLeftViewModel();
     settingViewModel = new WorkingDaysLeftSettingsViewModel();
     projectRepositoryMock = new Mock<IAsyncRepository<ProjectInfoServer>>();
 }