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

Build.BuildById added #77

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
3577da0
Build.BuildById was added
borismod Jun 20, 2014
a6867cc
EasyHttp package upgraded, NugetPackages restore set
borismod Jun 23, 2014
2868b49
BuildById method was enhanced to retrieve changes as well
borismod Jun 23, 2014
ec69d58
TeamCityCaller.GetDownloadFormat fixed to support urlPart with string…
borismod Jun 28, 2015
60589a3
Changes.byBuildId was added
borismod Jun 28, 2015
4e1d630
TeamCityCaller.GetDownloadFormat throw exception if status not OK
borismod Jun 29, 2015
1fd53e4
BuildNumber was added in build locator
borismod Jul 7, 2015
3cdc6a7
BuildLocator Number was improved
borismod Jul 7, 2015
bdd5637
TestOccurrences was added on TestClient
borismod Jul 13, 2015
0d77f30
TestOccurrenceById was added
borismod Jul 19, 2015
af7ed6d
Changes.ByBuildId was fixed and Changes.ByBuildIdWithDetails was added
borismod Jul 20, 2015
4609312
Update README.md
borismod Jul 20, 2015
f1b6e4b
TestHistoryByTestId was added
borismod Aug 2, 2015
4c1ec9e
ByBuildIdWithDetails improved to handle builds with no changes
borismod Aug 11, 2015
7552eae
CopyBuildConfiguration was added on BuildConfigs
borismod Aug 20, 2015
00b8ca0
TriggerBuildConfiguration method was added on BuildConfig
borismod Aug 23, 2015
9f2372b
BuildConfig methods added and improved:
borismod Aug 26, 2015
e126b2c
BuildConfigs.TriggerBuildConfiguration with parameters was added
borismod Aug 27, 2015
2d6d496
UpdateName was added on BuildConfigs
borismod Aug 30, 2015
032490d
Update README.md
borismod Aug 30, 2015
0e93762
TriggerBuildConfiguration was added with agentId
borismod Sep 8, 2015
238246d
Merge branch 'master' of https://github.com/borismod/TeamCitySharp
borismod Sep 8, 2015
12f2be2
TriggerBuildConfiguration was added to interface
borismod Sep 8, 2015
320ef85
Update README.md
borismod Sep 8, 2015
65f2b81
Investigations were added with two methods: InvestigationsById and In…
borismod Sep 9, 2015
e8e2306
Merge branch 'master' of https://github.com/borismod/TeamCitySharp
borismod Sep 9, 2015
b929f03
Update README.md
borismod Sep 9, 2015
2aefaec
InvestigationByTest, InvestigationsByBuildConfiguration and Investiga…
borismod Sep 17, 2015
d9ee904
Merge branch 'master' of https://github.com/borismod/TeamCitySharp
borismod Sep 17, 2015
6c005f7
Overload method was added to Builds.ByBuildLocator that enables retri…
borismod Oct 1, 2015
73a0014
ByBuildLocator was added to IBuilds reference
borismod Oct 1, 2015
b603a26
EasyHttp.1.6.67.0 was upgraded to EasyHttp.1.6.86.0
borismod Apr 10, 2016
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
Prev Previous commit
Next Next commit
Changes.ByBuildId was fixed and Changes.ByBuildIdWithDetails was added
  • Loading branch information
borismod committed Jul 20, 2015
commit af7ed6d03bb277d3ee74833f70cb212db1977f28
15 changes: 11 additions & 4 deletions src/TeamCitySharp/ActionTypes/Changes.cs
Original file line number Diff line number Diff line change
@@ -21,18 +21,25 @@ public List<Change> All()
return changeWrapper.Change;
}

public Change ByChangeId(string id)
public Change ByChangeId(long id)
{
var change = _caller.GetFormat<Change>("/app/rest/changes/id:{0}", id);

return change;
}

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

return changeWrapper.Change.Select(c => ByChangeId(c.Id)).ToList();
return changeWrapper.Change;
}

public List<Change> ByBuildIdWithDetails(long buildId)
{
var changes = ByBuildId(buildId);

return changes.Select(c => ByChangeId(c.Id)).ToList();
}

public List<Change> ByBuildConfigId(string buildConfigId)
5 changes: 3 additions & 2 deletions src/TeamCitySharp/ActionTypes/IChanges.cs
Original file line number Diff line number Diff line change
@@ -6,9 +6,10 @@ namespace TeamCitySharp.ActionTypes
public interface IChanges
{
List<Change> All();
Change ByChangeId(string id);
Change ByChangeId(long id);
Change LastChangeDetailByBuildConfigId(string buildConfigId);
List<Change> ByBuildConfigId(string buildConfigId);
List<Change> ByBuildId(string buildId);
List<Change> ByBuildId(long buildId);
List<Change> ByBuildIdWithDetails(long buildId);
}
}
2 changes: 1 addition & 1 deletion src/TeamCitySharp/DomainEntities/Build.cs
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ namespace TeamCitySharp.DomainEntities
{
public class Build
{
public string Id { get; set; }
public long Id { get; set; }
public string Number { get; set; }
public string Status { get; set; }
public string BuildTypeId { get; set; }
2 changes: 1 addition & 1 deletion src/TeamCitySharp/DomainEntities/Change.cs
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ public class Change
public string Username { get; set; }
public string WebLink { get; set; }
public string Href { get; set; }
public string Id { get; set; }
public long Id { get; set; }
public string Version { get; set; }
public DateTime Date { get; set; }
public string Comment { get; set; }
25 changes: 23 additions & 2 deletions src/Tests/IntegrationTests/SampleChangeUsage.cs
Original file line number Diff line number Diff line change
@@ -59,8 +59,8 @@ public void it_returns_all_changes()
Assert.That(changes.Any(), "Cannot find any changes recorded in any of the projects");
}

[TestCase("42843")]
public void it_returns_change_details_by_change_id(string changeId)
[TestCase(42843)]
public void it_returns_change_details_by_change_id(long changeId)
{
Change changeDetails = _client.Changes.ByChangeId(changeId);

@@ -74,5 +74,26 @@ public void it_returns_change_details_for_build_config(string buildConfigId)

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

[TestCase(191572)]
public void it_returns_change_for_build(int buildId)
{
// Act
List<Change> changes = _client.Changes.ByBuildId(buildId);

// Assert
Assert.That(changes.Count, Is.GreaterThan(1));
}

[TestCase(191572)]
public void it_returns_change_details_for_build(int buildId)
{
// Act
List<Change> changes = _client.Changes.ByBuildIdWithDetails(buildId);

// Assert
Assert.That(changes.Count, Is.GreaterThan(1));
Assert.That(changes.First().Comment, Is.Not.Null);
}
}
}