public void SetUp() { var taskCollection = new List <TaskInfo> { new TaskInfo { Question = @"Question 1", TargetMembers = new List <MemberType> { MemberType.Conclusive } }, new TaskInfo { Question = @"Question 2", TargetMembers = new List <MemberType> { MemberType.Conclusive } }, new TaskInfo { Question = @"Question 3", TargetMembers = new List <MemberType> { MemberType.Conclusive } }, new TaskInfo { Question = @"Question 4", TargetMembers = new List <MemberType> { MemberType.Conclusive } } }; _taskReader.Setup(c => c.Read()).Returns(taskCollection); _tasksStorage = new TasksStorage(_taskReader.Object); _tasksStorage.FillStorage(); }
public TaskManager(ITasksStorage tasksStorage, IServerStorage serversStorage, IWebApiClient apiClient) { this.tasksStorage = tasksStorage; this.serversStorage = serversStorage; this.apiClient = apiClient; this.RunAddOrUpdateProductTasks(); this.RunDeleteProductTasks(); }
public SettingsViewModel(IServerStorage storage, ITasksStorage tasksStorage) { this.storage = storage; this.tasksStorage = tasksStorage; this.NewServerViewModel = new NewServerViewModel(); this.Add = new RelayCommand(this.HandleAdd, this.CanAdd); this.Delete = new RelayCommand<ServerInformation>(this.HandleDelete); }
/// <summary> /// Инициализирует экземпляр <see cref="TestAnswerProcessing"/> /// </summary> /// <param name="telegramBotClient">Клиент telegram.</param> /// <param name="testStateController">Контроллер состояния пользователя.</param> /// <param name="tasksStorage">Хранилище задач.</param> /// <param name="tasksProcessing">Обработчик задач.</param> /// <param name="statisticsCollector">Сборщик статистики.</param> public TestAnswerProcessing(ITelegramBotClient telegramBotClient, ITestStateController testStateController, ITasksStorage tasksStorage, ITasksProcessing tasksProcessing, IStatisticsCollector statisticsCollector) { _subStates = new Dictionary <int, UserTestState>(); _telegramBotClient = telegramBotClient; _tasksProcessing = tasksProcessing; _testStateController = testStateController; _tasksStorage = tasksStorage; _statisticsCollector = statisticsCollector; }
/// <summary> /// Конструктор. /// </summary> /// <param name="tasksStorage">Хранилище задач.</param> /// <param name="referenceBookStorage">Хранилище справочника.</param> /// <param name="messageProcessors">Обработчики текстовых сообщений.</param> /// <param name="telegramBotClient">Клиент telegram.</param> public TelegramHandler( ITasksStorage tasksStorage, IReferenceBookStorage referenceBookStorage, IEnumerable <IMessageProcessing> messageProcessors, [NotNull] ITelegramBotClient telegramBotClient) { _telegramBotClient = telegramBotClient; _tasksStorage = tasksStorage; _referenceBookStorage = referenceBookStorage; _messageProcessors = messageProcessors; _cancellationToken = new CancellationTokenSource(); }