Skip to content
This repository was archived by the owner on Feb 12, 2019. It is now read-only.

Adding Changes.ByBuildId #69

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ Each area has its own list of methods available
Change ByChangeId(string id);
Change LastChangeDetailByBuildConfigId(string buildConfigId);
List<Change> ByBuildConfigId(string buildConfigId);
List<Change> ByBuildId(string buildId);

###BuildArtifacts
void DownloadArtifactsByBuildId(string buildId, Action<string> downloadHandler);
Expand Down
7 changes: 7 additions & 0 deletions src/TeamCitySharp/ActionTypes/Changes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ public List<Change> ByBuildConfigId(string buildConfigId)

return changeWrapper.Change;
}

public List<Change> ByBuildId(string buildId)
{
var changeWrapper = _caller.GetFormat<ChangeWrapper>("/app/rest/changes?build=id:{0}", buildId);

return changeWrapper.Change;
}

public Change LastChangeDetailByBuildConfigId(string buildConfigId)
{
Expand Down
1 change: 1 addition & 0 deletions src/TeamCitySharp/ActionTypes/IChanges.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ public interface IChanges
Change ByChangeId(string id);
Change LastChangeDetailByBuildConfigId(string buildConfigId);
List<Change> ByBuildConfigId(string buildConfigId);
List<Change> ByBuildId(string buildId);
}
}
8 changes: 8 additions & 0 deletions src/Tests/IntegrationTests/SampleChangeUsage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ public void it_returns_change_details_by_change_id(string changeId)
Change changeDetails = _client.Changes.ByChangeId(changeId);

Assert.That(changeDetails != null, "Cannot find details of that specified change");
}

[TestCase("104726")]
public void it_returns_change_details_by_build_id(string buildId)
{
var changes = _client.Changes.ByBuildId(buildId);

Assert.That(changes != null, string.Format("Cannot find any changes for build id {0}", buildId));
}

[TestCase("bt113")]
Expand Down