Exemplo n.º 1
0
            public void WhenDeveloperNotActiveDuringPeriod_ShouldReturnZero()
            {
                // arrange
                var author = new Author {
                    Name = "Moo", 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.Active_Days_Per_Week(author);
                // assert
                var expectedActiveDaysPerWeek = 0.0;

                actual.Should().Be(expectedActiveDaysPerWeek);
            }
Exemplo n.º 2
0
            public void WhenDeveloperActiveDuringPeriod_ShouldReturnTotalWorkingDays()
            {
                // 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.Active_Days_Per_Week(author);
                // assert
                var expectedActiveDaysPerWeek = 3.0;

                actual.Should().Be(expectedActiveDaysPerWeek);
            }