public void WhenDeveloperInactive_ShouldReturnZeroCommitsPerDay() { // arrange var author = new Author { Name = "boo", Emails = new List <string> { "*****@*****.**" } }; var repoPath = TestRepoPath("git-test-operations"); var sut = new SourceControlAnalysisBuilder() .WithPath(repoPath) .WithRange(DateTime.Parse("2018-06-25"), DateTime.Parse("2018-07-09")) .Build(); // act var actual = sut.Commits_Per_Day(author); // assert var expectedCommitsPerDay = 0.0; actual.Should().Be(expectedCommitsPerDay); }
public void WhenDeveloperActive_ShouldReturnCommitsPerDay() { // arrange var repoPath = TestRepoPath("git-test-operations"); var author = new Author { Name = "T-rav", Emails = new List <string> { "*****@*****.**" } }; var sut = new SourceControlAnalysisBuilder() .WithPath(repoPath) .WithRange(DateTime.Parse("2018-09-10"), DateTime.Parse("2018-09-14")) .WithWorkingDaysPerWeek(4) .WithWorkingWeekHours(32) .Build(); // act var actual = sut.Commits_Per_Day(author); // assert var expectedCommitsPerDay = 1.67; actual.Should().Be(expectedCommitsPerDay); }