Beispiel #1
0
        public MainViewModel()
        {
            DisplayName = "Jira flow metrics";

            var dataPath = GetPathToData();

            if (!Directory.Exists(dataPath))
            {
                Directory.CreateDirectory(dataPath);
            }

            string databaseFile = Path.Combine(dataPath, @"issuesCache.db");

            _cacheRepository = new SqliteJiraLocalCacheRepository(databaseFile);
            TasksSourceJiraCacheAdapter jiraCacheAdapter = new TasksSourceJiraCacheAdapter(_cacheRepository);
            JsonStatesRepository        statesRepository = new JsonStatesRepository(Path.Combine(dataPath, @"analysisSettings.json"));
            var stateFilteringProvider = new StateFilteringProvider(jiraCacheAdapter, statesRepository);
            var tasksSource            = new TasksSource(jiraCacheAdapter);

            var issuesFrom = DateTime.Now.AddYears(-1);

            ProjectSelector = new ProjectSelectorViewModel(tasksSource);

            Items.Add(new JiraUpdateViewModel(tasksSource, new CurrentTime()));
            Items.Add(new StoryFilteringViewModel(stateFilteringProvider));
            Items.Add(new IssuesGridViewModel(tasksSource, stateFilteringProvider, ProjectSelector));
            Items.Add(new CumulativeFlowViewModel(tasksSource, stateFilteringProvider, ProjectSelector));
            Items.Add(new CycleTimeScatterplotViewModel(tasksSource, issuesFrom, stateFilteringProvider, ProjectSelector));
            Items.Add(new CycleTimeHistogramViewModel(tasksSource, issuesFrom, stateFilteringProvider, ProjectSelector));
            Items.Add(new CycleTimeHistogramSmoothViewModel(tasksSource, issuesFrom, stateFilteringProvider, ProjectSelector));
            Items.Add(new CycleTimeHistoryViewModel(tasksSource, stateFilteringProvider, ProjectSelector));
            Items.Add(new StoryPointCycleTimeViewModel(tasksSource, issuesFrom, stateFilteringProvider, ProjectSelector));
            Items.Add(new SimulationViewModel(tasksSource, issuesFrom, stateFilteringProvider, ProjectSelector));
        }
        public StoryFilteringViewModelTest()
        {
            _jiraCacheAdapter       = new TestJiraCacheAdapter();
            _statesRepository       = new MemoryStatesRepository(new string[0], new string[0]);
            _stateFilteringProvider = new StateFilteringProvider(_jiraCacheAdapter, _statesRepository);
            _vm = new StoryFilteringViewModel(_stateFilteringProvider);

            EmulateCollectionSelectedItemChanging();
        }