示例#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 TasksSourceIssueAnalysisTest()
        {
            _jiraCacheAdapter = new TestJiraCacheAdapter();
            _tasksSource      = new TasksSource(_jiraCacheAdapter);

            _compareLogic = new CompareLogic(new ComparisonConfig()
            {
                IgnoreObjectTypes = true, MaxDifferences = 3
            });
        }
示例#3
0
        public JiraUpdateViewModelTest()
        {
            _jiraCacheAdapter = new TestJiraCacheAdapter();

            var tasksSource = new TasksSource(_jiraCacheAdapter);

            _currentTime = new TestCurrentTime()
            {
                UtcNow = new DateTime(2019, 1, 1)
            };
            _vm = new JiraUpdateViewModel(tasksSource, _currentTime);

            _view = new TestView();
            (_vm as IViewAware).AttachView(_view);
        }
        public CumulativeFlowViewModel(TasksSource source, IStateFilteringProvider stateFilteringProvider, ICurrentProject currentProject)
        {
            _source = source;
            _stateFilteringProvider = stateFilteringProvider;
            _currentProject         = currentProject;
            DisplayName             = "Cumulative flow";

            SeriesCollection = new SeriesCollection();
            XFormatter       = val => new DateTime((long)val).ToShortDateString();

            _currentProject.ProjectKeyChanged += async(sender, args) =>
            {
                if (IsActive)
                {
                    await Update();
                }
            };
        }