private ServerLoadUpdater GetServerLoadUpdater(DateTime lastCheck)
        {
            var interval = TimeSpan.FromSeconds(10);

            _lastServerLoadTimeProvider.LastChecked().Returns(lastCheck);
            _singleActionFactory.GetSingleAction(Arg.Any <Func <Task> >()).Returns(_task);

            return(new ServerLoadUpdater(
                       interval,
                       _serverManager,
                       _scheduler,
                       _eventAggregator,
                       _mainWindowState,
                       _apiServers,
                       _singleActionFactory,
                       _lastServerLoadTimeProvider));
        }
示例#2
0
 private bool TimeToUpdateLoads()
 {
     return(DateTime.Now.Subtract(_lastServerLoadTimeProvider.LastChecked()) > _updateInterval);
 }