public List<Change> GetChanges(Action<IChangesHavingBuilder> having, Action<IChangesIncludeBuilder> include) { var changesHavingBuilder = new ChangesHavingBuilder(m_BuildHavingBuilderFactory); having(changesHavingBuilder); var changesIncludeBuilder = new ChangesIncludeBuilder(); include(changesIncludeBuilder); var columns = changesIncludeBuilder.GetColumns(); var locator = changesHavingBuilder.GetLocator(); return m_TeamCityCaller.GetFormat<ChangesList>(@"/app/rest/changes?locator={0}&fields=change({1})", locator, columns).Change; }
public void IncludeFilesDefaults() { // Arrange + Act var changesIncludeBuilder = new ChangesIncludeBuilder(); changesIncludeBuilder.IncludeFiles(); var columns = changesIncludeBuilder.GetColumns(); // Assert columns.Should().Be("id,version,href,username,date,webUrl,files"); }
public void IncludeVcsRootInstance() { // Arrange + Act var changesIncludeBuilder = new ChangesIncludeBuilder(); changesIncludeBuilder.IncludeVcsRootInstance(); var columns = changesIncludeBuilder.GetColumns(); // Assert columns.Should().Be("id,version,href,username,date,webUrl,vcsRootInstance"); }
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"); }