Inheritance: IBuildAdditionalIncludeBuilder
        public void ShouldIncludeChanges_False()
        {
            // Arrange
            var buildAdditionalIncludeBuilder = new BuildAdditionalIncludeBuilder();

            // Act
            var shouldIncludeChanges = buildAdditionalIncludeBuilder.ShouldIncludeChanges;

            // Assert
            shouldIncludeChanges.Should().BeFalse();
        }
        public void ShouldIncludeChanges_True()
        {
            // Arrange
            var buildAdditionalIncludeBuilder = new BuildAdditionalIncludeBuilder();

            // Act
            buildAdditionalIncludeBuilder.IncludeChanges(_ => _.IncludeComment());
            var shouldIncludeChanges = buildAdditionalIncludeBuilder.ShouldIncludeChanges;

            // Assert
            shouldIncludeChanges.Should().BeTrue();
            var changesIncludeBuilder = new ChangesIncludeBuilder();
            buildAdditionalIncludeBuilder.ChangesInclude(changesIncludeBuilder);
            changesIncludeBuilder.GetColumns().Should().Be("id,version,href,username,date,webUrl,comment");
        }
Beispiel #3
0
 public IBuild GetLastBuild(Action<IBuildHavingBuilder> having, Action<IBuildAdditionalIncludeBuilder> include)
 {
     var builds = GetBuilds(having, _ => _.IncludeDefaults(), __ => __.Count(1));
     if (!builds.Any()) throw new BuildNotFoundException();
     var lastBuild = GetBuild(builds.First().Id);
     var buildAdditionalIncludeBuilder = new BuildAdditionalIncludeBuilder();
     include(buildAdditionalIncludeBuilder);
     if (buildAdditionalIncludeBuilder.ShouldIncludeChanges)
     {
         var changes = m_ChangesRetriever.GetChanges(_ => _.Build(__ => __.Id(lastBuild.Id)),
             buildAdditionalIncludeBuilder.ChangesInclude);
         lastBuild.SetChanges(changes);
     }
     return lastBuild;
 }