public void GetAll_ReadsAllFiles()
        {
            var buildFileManager = new BuildFileManager("../../BuildSessionFiles", _dateTimeProviderMock);

            var buildSessions = buildFileManager.GetAll();

            buildSessions.Count().ShouldBeGreaterThan(1);
        }
        public void GetTodaysBuildSession_FileExists_ReadOnlyThisFile()
        {
            var buildFileManager = new BuildFileManager("../../BuildSessionFiles", _dateTimeProviderMock);

            var buildSessions = buildFileManager.GetTodaysBuildSession();

            buildSessions.StartTime.Date.ShouldBe(now.Date);
        }
        public void GetTodaysBuildSession_FileDoesNotExist_CreatesNewSession()
        {
            var veryOldDate = new DateTime(1980, 1, 1, 1, 1, 1);
            var veryOldDateTimeProviderMock = new DateTimeProviderMock(veryOldDate);
            var buildFileManager            = new BuildFileManager(BuildSessionFolder, veryOldDateTimeProviderMock);

            var buildSessions = buildFileManager.GetTodaysBuildSession();

            buildSessions.StartTime.Date.ShouldBe(veryOldDate.Date);
        }
Exemple #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="VSBuildTimeReportWindow"/> class.
        /// </summary>
        public VSBuildTimeReportWindowPackage()
        {
            // Inside this method you can place any initialization code that does not require
            // any Visual Studio service because at this point the package object is created but
            // not sited yet inside Visual Studio environment. The place to do all the other
            // initialization is the Initialize method.

            var buildTimeReportFolderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "VSBuildTimeReport");

            _buildFileManager = new BuildFileManager(buildTimeReportFolderPath, new DateTimeProvider());
        }
        private void RefreshData()
        {
            var buildTimeReportFolderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
                                                         "VSBuildTimeReport");

            var buildFileManager = new BuildFileManager(buildTimeReportFolderPath, new DateTimeProvider());
            var buildSessions    = buildFileManager.GetAll();

            var report = new BuildReport(buildSessions);

            var reportLines = report.GetProjectsReport();

            reportGrid.ItemsSource = reportLines;
        }
        public void DeleteBuild(string hash)
        {
            string buildpath = Path.Combine(path, BUILD_PATH, hash, BUILD_EXT);

            BuildFileManager.DeleteBuild(buildpath);
        }
        public Build GetBuild(string hash)
        {
            string buildpath = Path.Combine(path, BUILD_PATH, hash, BUILD_EXT);

            return(BuildFileManager.LoadBuild(buildpath, this));
        }
        public void CreateBuild(Build build)
        {
            string buildpath = Path.Combine(path, BUILD_PATH, build.Hash, BUILD_EXT);

            BuildFileManager.CreateBuild(buildpath, build);
        }