Example #1
0
        public List <DeveloperStats> Build_Individual_Developer_Stats(IEnumerable <Author> authors)
        {
            var result = new List <DeveloperStats>();

            foreach (var developer in authors)
            {
                var changeStats = Change_Stats(developer);
                var stats       = new DeveloperStats
                {
                    Author               = developer,
                    PeriodActiveDays     = Period_Active_Days(developer),
                    ActiveDaysPerWeek    = Active_Days_Per_Week(developer),
                    CommitsPerDay        = Commits_Per_Day(developer),
                    Impact               = Impact(developer),
                    LinesOfChangePerHour = changeStats.ChangePerHour,
                    LinesAdded           = changeStats.Added,
                    LinesRemoved         = changeStats.Removed,
                    Churn  = changeStats.Churn,
                    Rtt100 = changeStats.Rtt100,
                    Ptt100 = changeStats.Ptt100
                };
                result.Add(stats);
            }

            return(result);
        }
Example #2
0
        public void RiskFactor_WhenLinesOfchangePerHourAndCommitsPerDayNonZero_ShouldReturnDivisionToTwoDecimalPlaces()
        {
            // arragne
            var sut = new DeveloperStats {
                LinesOfChangePerHour = 1, CommitsPerDay = 3
            };
            // act
            var actual = sut.RiskFactor;

            // assert
            actual.Should().Be(0.33);
        }
Example #3
0
        public void RiskFactor_WhenLinesOfchangePerHourNonZeroAndCommitsPerDayZero_ShouldReturnZero()
        {
            // arragne
            var sut = new DeveloperStats {
                LinesOfChangePerHour = 10, CommitsPerDay = 0
            };
            // act
            var actual = sut.RiskFactor;

            // assert
            actual.Should().Be(0.0);
        }