Пример #1
0
        private void NewTargetCoverageShouldBe(int targetCoverage, int newCoverage, int result)
        {
            //// Arrange
            var reportEntity = new CoverageEntity();

            reportEntity.Coverage = newCoverage;

            var target = new CoverageEntity();

            target.TargetCoverage = targetCoverage;

            //// Act
            target.UpdateCoverage(reportEntity);
            //// Assert
            target.NewTargetCoverage.Should().Be(result);
        }
Пример #2
0
        private void LastCoverageShouldBe(int coverage, int newCoverage)
        {
            //// Arrange
            var reportEntity = new CoverageEntity();

            reportEntity.Coverage = newCoverage;

            var target = new CoverageEntity();

            target.Coverage = coverage;

            //// Act
            target.UpdateCoverage(reportEntity);

            //// Assert
            target.LastCoverage.Should().Be(coverage);
        }
Пример #3
0
        private void CoverageStatusShouldBe(int coverage, int newCoverage, CoverageStatus result)
        {
            //// Arrange
            var reportEntity = new CoverageEntity();

            reportEntity.Coverage = newCoverage;

            var target = new CoverageEntity();

            target.Coverage = coverage;

            //// Act
            target.UpdateCoverage(reportEntity);

            //// Assert
            target.Status.Should().Be(result);
        }
Пример #4
0
        public void Test涵蓋率未下降則不發通知()
        {
            //// Arrange
            var coverageEntity = new RepositoryCoverageEntity
            {
                Repository = "Phanerozoic"
            };

            var reportMethod = new CoverageEntity
            {
                Class    = "AClass",
                Method   = "AMethod",
                Coverage = 23,
            };
            var sheetMethod = new CoverageEntity
            {
                Class    = "AClass",
                Method   = "AMethod",
                Coverage = 23,
            };

            sheetMethod.UpdateCoverage(reportMethod);

            var methodList = new List <CoverageEntity>
            {
                sheetMethod,
            };

            var stringBuilder = new StringBuilder();

            stringBuilder.AppendLine(sheetMethod.ToString());
            var expectedMessage = stringBuilder.ToString();

            //// Act
            var target = GetTarget();

            target.Notify(coverageEntity, methodList);

            //// Assert
            this._stubSlackService.DidNotReceiveWithAnyArgs().SendAsync(string.Empty, Arg.Any <string>());
        }