コード例 #1
0
        public void Return_milliseconds_between_failing_and_next_succeeding_build()
        {
            var builds = new List <Build>
            {
                new Build
                {
                    Id             = 999,
                    BuildTypeId    = "blah blah",
                    StartDateTime  = new DateTime(2017, 10, 31, 15, 3, 30),
                    FinishDateTime = new DateTime(2017, 10, 31, 15, 5, 30),
                    AgentName      = "agent name",
                    Status         = "Failure",
                    State          = "Finished"
                },
                new Build
                {
                    Id             = 1001,
                    BuildTypeId    = "blah blah",
                    StartDateTime  = new DateTime(2017, 10, 31, 15, 3, 30),
                    FinishDateTime = new DateTime(2017, 10, 31, 16, 5, 30),
                    AgentName      = "agent name",
                    Status         = "Success",
                    State          = "Finished"
                }
            };

            _build.GetBuilds().Returns(builds);

            var results = new BuildMetricCalculator(_tellTheTime, _build).CalculateBuildStability(
                new BuildFilter(6, "All", "All"), new BuildStabilityMetric());

            Assert.That(results.First().RecoveryTime, Is.EqualTo(1));
        }
コード例 #2
0
        public void Return_ignored_test_count_by_week()
        {
            _build.GetBuilds().Returns(GetBuilds());

            var results = new BuildMetricCalculator(_tellTheTime, _build).CalculateBuildStability(
                new BuildFilter(6, "All", "All"), new BuildStabilityMetric());

            Assert.That(results.First().IgnoredTestCount, Is.EqualTo(2));
        }
コード例 #3
0
        public void Should_calculate_failure_percentage_by_week()
        {
            _build.GetBuilds().Returns(GetBuilds());

            var results = new BuildMetricCalculator(_tellTheTime, _build).CalculateBuildStability(
                new BuildFilter(6, "All", "All"), new BuildStabilityMetric());

            Assert.That(results.Count, Is.EqualTo(6));
            Assert.That(results.First().Date, Is.EqualTo(new DateTime(2017, 10, 29)));
        }